mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-11-10 07:48:22 +08:00
fix: 移除user的持久化修复其导致的问题 (#314)
* perf: 增加配置判断 (#311) 新增配置项判断,避免出现undefined导致的无效url * fix: 移除user的持久化修复其导致的问题 Co-authored-by: Kerwin Bryant <kerwin612@qq.com>
This commit is contained in:
parent
e1bc0a0d87
commit
0e259413ca
|
@ -1,6 +1,6 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { TOKEN_NAME } from '@/config/global';
|
import { TOKEN_NAME } from '@/config/global';
|
||||||
import { store, usePermissionStore } from '@/store';
|
import { store } from '@/store';
|
||||||
|
|
||||||
const InitUserInfo = {
|
const InitUserInfo = {
|
||||||
roles: [],
|
roles: [],
|
||||||
|
@ -79,12 +79,6 @@ export const useUserStore = defineStore('user', {
|
||||||
this.token = '';
|
this.token = '';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
persist: {
|
|
||||||
afterRestore: (ctx) => {
|
|
||||||
const permissionStore = usePermissionStore();
|
|
||||||
permissionStore.initRoutes(ctx.store.roles);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export function getUserStore() {
|
export function getUserStore() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user