token退出删除

This commit is contained in:
2024-03-18 14:05:30 +08:00
parent d70138ad76
commit fa393b8fd1
3 changed files with 4 additions and 2 deletions

View File

@@ -65,7 +65,7 @@
})
},
Quit () {
this.$store.dispatch('delUserInfo')
this.$store.dispatch('delUserInfo', '')
uni.redirectTo({
url: '/pages/login/login'
})

View File

@@ -64,7 +64,7 @@ const request = (params) => {
content: `${res[1].data.message}`,
showCancel: false
})
store.dispatch('delUserInfo')
store.dispatch('delUserInfo', '')
uni.redirectTo({
url: '/pages/login/login'
})

View File

@@ -38,6 +38,7 @@ const actions = {
},
delUserInfo({commit}, res) {
uni.clearStorageSync('userInfo')
uni.clearStorageSync('saveToken')
commit(types.DEL_USER_INFO, res)
},
saveToken({commit}, res) {
@@ -61,6 +62,7 @@ const mutations = {
},
[types.DEL_USER_INFO] (state, res) {
state.userInfo = res
state.saveToken = res
},
[types.SAVE_TOKEN] (state, res) {
state.saveToken = res