全局开发

This commit is contained in:
2024-08-02 17:26:50 +08:00
parent 1fa746d6cb
commit 03e0d44dd6
20 changed files with 931 additions and 1067 deletions

View File

@@ -89,16 +89,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