登录bug

This commit is contained in:
蔡玲
2024-12-24 10:05:14 +08:00
parent 1a153dd60c
commit 8659e0cf78

View File

@@ -77,16 +77,23 @@
}
try {
let res = await handLogin(this.user, RSAencrypt(this.password))
if (this.saveUser) {
this.$store.dispatch('saveLoginName', this.user)
if (res.code === '200') {
if (this.saveUser) {
this.$store.dispatch('saveLoginName', this.user)
} else {
this.$store.dispatch('delLoginName', '')
}
this.$store.dispatch('saveUserInfo', JSON.stringify(res.data.user))
this.$store.dispatch('saveToken', res.token)
uni.redirectTo({
url: '/pages/home/home'
})
} else {
this.$store.dispatch('delLoginName', '')
uni.showToast({
title: res.msg,
icon: 'none'
})
}
this.$store.dispatch('saveUserInfo', JSON.stringify(res.user.user))
this.$store.dispatch('saveToken', res.token)
uni.redirectTo({
url: '/pages/home/home'
})
this.disabled = false
} catch (e) {
this.disabled = false