This commit is contained in:
2022-10-10 19:58:07 +08:00
parent e7806048b7
commit 1702a7c6a3
9 changed files with 142 additions and 42 deletions

View File

@@ -46,9 +46,9 @@
})
},
async toLogin() {
uni.redirectTo({
url: '/pages/home/home'
})
// uni.redirectTo({
// url: '/pages/home/home'
// })
this.disabled = true
if (this.user === '') {
uni.showToast({
@@ -68,22 +68,16 @@
}
try {
let res = await handLogin(this.user, RSAencrypt(this.password))
if(res.code === '1') {
if (this.saveUser) {
this.$store.dispatch('saveLoginName', this.user)
} else {
this.$store.dispatch('delLoginName', '')
}
this.$store.dispatch('saveUserInfo', JSON.stringify(res.result))
uni.redirectTo({
url: '/pages/home/home'
})
if (this.saveUser) {
this.$store.dispatch('saveLoginName', this.user)
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
this.$store.dispatch('delLoginName', '')
}
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