登录
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user