mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-02-03 02:54:40 +08:00
fix: fixed token clear error
修复将token设置为undefined时可能失败的问题
This commit is contained in:
parent
f87b0f2f5e
commit
9640484895
@ -58,7 +58,7 @@ export const useUserStore = defineStore({
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
setToken(info: string | undefined) {
|
setToken(info: string | undefined) {
|
||||||
this.token = info;
|
this.token = info ? info : ''; // for null or undefined value
|
||||||
setAuthCache(TOKEN_KEY, info);
|
setAuthCache(TOKEN_KEY, info);
|
||||||
},
|
},
|
||||||
setRoleList(roleList: RoleEnum[]) {
|
setRoleList(roleList: RoleEnum[]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user