修复:允许路由在框架外显示
This commit is contained in:
@@ -93,6 +93,8 @@ export function formatTwoStageRoutes(arr: any) {
|
||||
return newArr;
|
||||
}
|
||||
|
||||
const frameOutRoutes = staticRoutes.map(item => item.path)
|
||||
|
||||
// 路由加载前
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
NProgress.configure({showSpinner: false});
|
||||
@@ -109,8 +111,9 @@ router.beforeEach(async (to, from, next) => {
|
||||
} else if (token && to.path === '/login') {
|
||||
next('/home');
|
||||
NProgress.done();
|
||||
}else if(token && frameOutRoutes.includes(to.path) ){
|
||||
next()
|
||||
} else {
|
||||
|
||||
const storesRoutesList = useRoutesList(pinia);
|
||||
const {routesList} = storeToRefs(storesRoutesList);
|
||||
if (routesList.value.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user