This commit is contained in:
bb_pan 2025-06-13 15:35:01 +08:00
parent 144d1d4421
commit 84a3419032
1 changed files with 22 additions and 4 deletions

View File

@ -4,7 +4,7 @@
<!-- 如果是h5时则显示登录页面 -->
/*#ifdef H5 */
<view class="login" >
<view class="login">
<uni-forms :modelValue="loginForm" label-position="top" class="login-form">
<h1>用户登录</h1>
<uni-forms-item required label="用户名">
@ -34,7 +34,6 @@
<view class="login-btn" @tap="onHandleLogin">登录</view>
</uni-forms>
</view>
</template>
<script setup>
@ -73,7 +72,7 @@ onMounted(async () => {
} else {
ticket.value = ''
}
console.log('🚀 ~ onMounted ~ origin:', val)
if (val.ticket) {
try {
@ -103,7 +102,26 @@ onMounted(async () => {
} catch (error) {
console.log(error)
uni.hideLoading()
showToast('登录失败')
uni.showToast({ title: '登录失败!', icon: 'none' })
}
} else {
if (!isDev) {
uni.showModal({
title: '提示',
content: '请从i皖送APP登录',
showCancel: false,
confirmText: '退出',
success: () => {
// APP
if (plus) {
plus.runtime.quit()
} else {
document.addEventListener('plusready', function () {
plus.runtime.quit()
})
}
},
})
}
}
})