refactor(projects): 代码优化

This commit is contained in:
Soybean
2022-05-09 20:46:27 +08:00
parent 92b8406444
commit 3590b65e22
11 changed files with 189 additions and 168 deletions

View File

@ -67,7 +67,8 @@ export const useAuthStore = defineStore('auth-store', {
setUserInfo(data);
// 更新状态
Object.assign(this, { userInfo: data, token });
this.userInfo = data;
this.token = token;
// 跳转登录后的地址
toLoginRedirect();

View File

@ -69,7 +69,8 @@ export const useTabStore = defineStore('tab-store', {
*/
addTab(route: RouteLocationNormalizedLoaded) {
if (!isInTabRoutes(this.tabs, route.path)) {
this.tabs.push(getTabRouteByVueRoute(route));
const tab = getTabRouteByVueRoute(route);
this.tabs.push(tab);
}
},
/**