Commit c1e29238 by pangchong

feat: 调整

parent 28d02d1c
......@@ -7,6 +7,9 @@
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"compatible" : {
"ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
},
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
......
......@@ -77,13 +77,14 @@ const useUserStore = defineStore('mocpUser', {
},
//退出登录
handleLogOut() {
this.token = ''
this.userInfo = undefined
this.resetUserInfo()
//返回登录页面
uni.$mocpJump.redirectTo('/login/index')
},
//重置席位权限
resetSeat() {
//重置用户信息
resetUserInfo() {
this.token = ''
this.userInfo = undefined
this.seatId = ''
this.seatPermission = ['all']
this.configData = []
......
......@@ -58,7 +58,7 @@ watch(
)
const userStore = useUserStore()
onLoad(() => {
userStore.resetSeat()
userStore.resetUserInfo()
loginForm.verifyCode = ''
getGifCaptcha()
loginAmms()
......@@ -75,6 +75,7 @@ const handleLogin = async () => {
})
loading.value = true
await login()
if (userStore.token) {
//加入席位权限
await getUserSeatList()
if (userStore.seatId) {
......@@ -84,6 +85,7 @@ const handleLogin = async () => {
}
//跳转工作台
uni.$mocpJump.redirectTo('/tab/index')
}
} catch (error) {
uni.$mocpMessage.error('登录失败')
} finally {
......@@ -96,6 +98,7 @@ const login = async () => {
const res = await loginApi(toRaw(loginForm))
if (res.code == 200) {
userStore.setUserInfo(res.data)
return true
} else {
uni.$mocpMessage.error(res.message)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment