优化
This commit is contained in:
parent
e21b444cdb
commit
90e52e7410
@ -179,7 +179,7 @@
|
||||
import { useTabsViewStore } from '@/store/modules/tabsView';
|
||||
import { computed, ref, unref, watch, inject } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { TABS_ROUTES } from '@/store/mutation-types';
|
||||
import { TABS_ROUTES,FIRST_ROUTE } from '@/store/mutation-types';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { useLockscreenStore } from '@/store/modules/lockscreen';
|
||||
import { useProjectSetting } from '@/hooks/setting/useProjectSetting';
|
||||
@ -343,6 +343,7 @@
|
||||
// 移除标签页
|
||||
tabsViewStore.closeAllTabs();
|
||||
localStorage.removeItem(TABS_ROUTES);
|
||||
localStorage.removeItem(FIRST_ROUTE);
|
||||
asyncRouteStore.setDynamicAddedRoute(false);
|
||||
window.location.reload();
|
||||
router.replace({
|
||||
|
@ -122,7 +122,7 @@
|
||||
import { computed, ref, unref, provide, watch, onMounted, nextTick, toRaw, inject } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { storage } from '@/utils/Storage';
|
||||
import { TABS_ROUTES } from '@/store/mutation-types';
|
||||
import { TABS_ROUTES,FIRST_ROUTE } from '@/store/mutation-types';
|
||||
import { useTabsViewStore } from '@/store/modules/tabsView';
|
||||
import { useAsyncRouteStore } from '@/store/modules/asyncRoute';
|
||||
import { RouteItem } from '@/store/modules/tabsView';
|
||||
@ -385,7 +385,7 @@
|
||||
// 关闭全部
|
||||
const closeAll = () => {
|
||||
tabsViewStore.closeAllTabs();
|
||||
router.replace(storage.get('FIRST-PATH'));
|
||||
router.replace(storage.get(FIRST_ROUTE));
|
||||
// router.replace(PageEnum.BASE_HOME_REDIRECT);
|
||||
updateNavScroll();
|
||||
};
|
||||
|
@ -2,7 +2,7 @@ import type { RouteRecordRaw } from 'vue-router';
|
||||
import { isNavigationFailure, Router } from 'vue-router';
|
||||
import { useUserStoreWidthOut } from '@/store/modules/user';
|
||||
import { useAsyncRouteStoreWidthOut } from '@/store/modules/asyncRoute';
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types';
|
||||
import { ACCESS_TOKEN,FIRST_ROUTE } from '@/store/mutation-types';
|
||||
import { storage } from '@/utils/Storage';
|
||||
import { PageEnum } from '@/enums/pageEnum';
|
||||
import { ErrorPageRoute,AboutPageRoute } from '@/router/base';
|
||||
@ -69,7 +69,7 @@ export function createRouterGuards(router: Router) {
|
||||
}
|
||||
router.addRoute(AboutPageRoute as unknown as RouteRecordRaw);
|
||||
const firstRoutePath = findFirstRoutePath(routes)
|
||||
storage.set('FIRST-PATH',firstRoutePath)
|
||||
storage.set(FIRST_ROUTE,firstRoutePath)
|
||||
if (from.path === LOGIN_PATH && (to.name === 'errorPage' || !to.name)) {
|
||||
next(firstRoutePath);
|
||||
return;
|
||||
|
@ -2,3 +2,4 @@ export const ACCESS_TOKEN = 'ACCESS-TOKEN'; // 用户token
|
||||
export const CURRENT_USER = 'CURRENT-USER'; // 当前用户信息
|
||||
export const IS_LOCKSCREEN = 'IS-LOCKSCREEN'; // 是否锁屏
|
||||
export const TABS_ROUTES = 'TABS-ROUTES'; // 标签页
|
||||
export const FIRST_ROUTE = 'FIRST-ROUTE'; // 菜单第一个路由
|
||||
|
Loading…
Reference in New Issue
Block a user