update src/views/Login/components/MobileForm.vue.
我发现,这个手机号登陆时,登陆成功了但是没有自动跳转,我手动路由到/,又自动跳转到登陆页面,应该是token没存进去,我就照这loginform的逻辑修改了一下
Signed-off-by: water <2778335106@qq.com>
(cherry picked from commit b061c8f32b
)
This commit is contained in:
parent
85cc7cdb46
commit
e7e0c7a6b7
@ -183,12 +183,17 @@ const signIn = async () => {
|
|||||||
await getTenantId()
|
await getTenantId()
|
||||||
const data = await validForm()
|
const data = await validForm()
|
||||||
if (!data) return
|
if (!data) return
|
||||||
|
ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '正在加载系统中...',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
|
})
|
||||||
loginLoading.value = true
|
loginLoading.value = true
|
||||||
smsVO.loginSms.mobile = loginData.loginForm.mobileNumber
|
smsVO.loginSms.mobile = loginData.loginForm.mobileNumber
|
||||||
smsVO.loginSms.code = loginData.loginForm.code
|
smsVO.loginSms.code = loginData.loginForm.code
|
||||||
await smsLoginApi(smsVO.loginSms)
|
await smsLoginApi(smsVO.loginSms)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
setToken(res?.token)
|
setToken(res)
|
||||||
if (!redirect.value) {
|
if (!redirect.value) {
|
||||||
redirect.value = '/'
|
redirect.value = '/'
|
||||||
}
|
}
|
||||||
@ -197,6 +202,10 @@ const signIn = async () => {
|
|||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
loginLoading.value = false
|
loginLoading.value = false
|
||||||
|
setTimeout(() => {
|
||||||
|
const loadingInstance = ElLoading.service()
|
||||||
|
loadingInstance.close()
|
||||||
|
}, 400)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user