修改登录bug

This commit is contained in:
zhouyanli
2026-05-13 17:52:57 +08:00
parent 750260e21c
commit 8324d096c0
2 changed files with 1 additions and 65 deletions

View File

@@ -177,7 +177,7 @@ const submitForm = async () => {
return
}
// 提交数据
uni.showLoading({ title: '提交中...' ,})
uni.showLoading({ title: '提交中...' ,mask:true})
try {
// 先上传图片
const imageUrls = await uploadImages()

View File

@@ -182,65 +182,6 @@ const getVerifyCode = () => {
})
}
// 登录处理
const handleLogin = () => {
if (!canLogin.value) return
uni.showLoading({
title: '登录中...',
mask: true
})
let params = {
phone: phoneNumber.value,
smsCode: verifyCode.value,
scene: 'butler_login'
}
getLoginBySms(params)
.then(res => {
if (res.code === 200) {
if (res.data) {
uni.setStorageSync('token', res.data.token)
// 存用户ID
if (res.data.userId) {
uni.setStorageSync('userId', res.data.userId)
}
// 存当前绑定的小区ID,0 表示未绑定
const currentVillageId = res.data.currentVillageId || 0
uni.setStorageSync('currentVillageId', currentVillageId)
uni.hideLoading()
uni.showToast({
title: '登录成功',
icon: 'success'
})
setTimeout(() => {
uni.switchTab({
url: '/pages/index/index'
})
}, 1500)
} else {
uni.showToast({
title: '登录失败',
icon: 'error'
})
}
} else {
uni.showToast({
title: '登录失败',
icon: 'error'
})
}
})
.catch(err => {
uni.showToast({
title: err.msg,
icon: 'error'
})
})
// 模拟登录请求
// uni.showLoading({
// title: '登录中...'
// });
}
// 登录处理
const handleLogin = () => {
if (!phoneNumber.value) {
@@ -313,11 +254,6 @@ const handleLogin = () => {
icon: 'error'
})
})
// 模拟登录请求
// uni.showLoading({
// title: '登录中...'
// });
}
// ========== 生命周期 ==========