fix: 移除user的持久化修复其导致的问题 (#314)

* perf: 增加配置判断 (#311)

新增配置项判断,避免出现undefined导致的无效url

* fix: 移除user的持久化修复其导致的问题

Co-authored-by: Kerwin Bryant <kerwin612@qq.com>
This commit is contained in:
悠静萝莉 2022-09-17 00:24:20 +08:00 committed by GitHub
parent e1bc0a0d87
commit 0e259413ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
import { defineStore } from 'pinia';
import { TOKEN_NAME } from '@/config/global';
import { store, usePermissionStore } from '@/store';
import { store } from '@/store';
const InitUserInfo = {
roles: [],
@ -79,12 +79,6 @@ export const useUserStore = defineStore('user', {
this.token = '';
},
},
persist: {
afterRestore: (ctx) => {
const permissionStore = usePermissionStore();
permissionStore.initRoutes(ctx.store.roles);
},
},
});
export function getUserStore() {