Merge branch 'StableVersion' into develop

This commit is contained in:
X1627315083
2024-03-08 11:19:33 +08:00
20 changed files with 1256 additions and 665 deletions

View File

@@ -9,7 +9,7 @@ const routes: Array<RouteRecordRaw> = [
path: "/",
// redirect重定向
redirect: "/login"
// redirect: "/Upgrade"
// redirect: "/upgrade"
},
{
path: '/login',
@@ -89,15 +89,13 @@ router.beforeEach((to, from, next) => {
// 检查路由是否存在
// 机房用户
let userInfo = JSON.parse(getCookie("userInfo") as any);
console.log(userInfo);
let murmurStr: any = localStorage.getItem('murmurStr')
let getIsMurmur: any = getCookie("isMurmur")
let token = getCookie("token");
let isMurmur = JSON.parse(getIsMurmur)
let routeList = ['/testClickData']
let userIdList = [83]
let routeList = ['/testClickData','/trialApproval']//指定页面需要指定id才能进入
let userIdList = [83,88,6]
const routeExists = router.getRoutes().some(({ name }) =>{
if(name){
return name === to.name
@@ -105,33 +103,31 @@ router.beforeEach((to, from, next) => {
return false
}
});
if (routeExists) {
if (isMurmur && murmurStr && token) {
const toName = to.name === 'login';
if (toName) {
next({ name: 'home' });
} else {
next();
// 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 ) {
}
} else {
if (routeList.indexOf(to.path) > -1 ) {
// if(userIdList.indexOf(userInfo.userId) > -1){
// next();
// }else{
// next({ name: 'home' });
// }
// }else{
// next();
// }
// // 如果页面存在,正常跳转
// }
// } else {
// // 如果页面不存在可以跳转到404页面或者其他页面
// next('/404');
// }
if(userIdList.indexOf(userInfo.userId) > -1){
next();
}else{
next({ name: 'home' });
}
}else{
next();
}
// 如果页面存在,正常跳转
}
} else {
// 如果页面不存在可以跳转到404页面或者其他页面
next('/404');
}
});