This commit is contained in:
X1627315083
2024-09-26 15:43:27 +08:00
parent ae4ef573e4
commit e26d57dd76
16 changed files with 743 additions and 386 deletions

View File

@@ -241,11 +241,21 @@ const routes: Array<RouteRecordRaw> = [
name: 'feedbackSurveyCN',
component: _import('feedbackSurveyCN'),
},
{
path: '/emailVerify',
name: 'emailVerify',
component: _import('emailVerify'),
},
{
path: '/404',
name: '404',
component: _import('404')
},
{
path: "/:catchAll(.*)",
redirect: "/404",
},
]
const router = createRouter({
@@ -308,7 +318,7 @@ let setMurmur = (id:any)=> {
}
router.beforeEach((to:any, from, next) => {
let upgradeList = ['/feedbackSurvey','/feedbackSurveyCN']//指定页面系统维护也可以访问
let upgradeList = ['/feedbackSurvey','/feedbackSurveyCN','emailVerify']//指定页面系统维护也可以访问
// 系统维护
// const toName = to.name === 'upgrade';
@@ -366,30 +376,27 @@ router.beforeEach((to:any, from, next) => {
}
return
}
if (routeExists) {//检测档期那页面是否存在
if (isMurmur && murmurStr && token) {
const toName = to.name === 'login';
if (toName) {
next({ name: '/home' });//机房用户
} else {
next();
}
} else {
if (routeList.indexOf(to.path) > -1 ) {//指定也买你必须指定用户可以进入
if(userIdList.indexOf(userInfo.userId) > -1){
next();
}else{
next({ name: '/404' });
}
}else{
next();
}
// 如果页面存在,正常跳转
}
if (isMurmur && murmurStr && token) {
const toName = to.name === 'login';
if (toName) {
return next({ name: '/home' });//机房用户
}
} else {
// 如果页面不存在可以跳转到404页面或者其他页面
next('/404');
if (routeList.indexOf(to.path) > -1 ) {//指定也买你必须指定用户可以进入
if(userIdList.indexOf(userInfo.userId) > -1){
}else{
return next({ name: '/404' });
}
}
// 如果页面存在,正常跳转
}
next();
// if (routeExists) {//检测档期那页面是否存在
// } else {
// // 如果页面不存在可以跳转到404页面或者其他页面
// next('/404');
// }
});