|
|
@@ -16,14 +16,14 @@ const router = createRouter({
|
|
|
},
|
|
|
|
|
|
// 登录与注册
|
|
|
- // {
|
|
|
- // path: "/",
|
|
|
- // redirect: () => {
|
|
|
- // window.location.href = "https://p-nju.seec.seecoder.cn/login?from=https://air.seec.seecoder.cn/";
|
|
|
- // // {本地门户首页地址}?from={本地eai首页地址}
|
|
|
- // return "/"; // 占位返回值,实际不会执行
|
|
|
- // },
|
|
|
- // },
|
|
|
+ {
|
|
|
+ path: "/",
|
|
|
+ redirect: () => {
|
|
|
+ window.location.href = "https://p-nju.seec.seecoder.cn/login?from=https://air.seec.seecoder.cn/";
|
|
|
+ // {本地门户首页地址}?from={本地eai首页地址}
|
|
|
+ return "/"; // 占位返回值,实际不会执行
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
path: "/",
|
|
|
redirect: "/login"
|
|
|
@@ -35,7 +35,7 @@ const router = createRouter({
|
|
|
},
|
|
|
{
|
|
|
path: '/register',
|
|
|
- name: 'register',
|
|
|
+ name: 'register',
|
|
|
component: () => import('../views/LoginPage/RegisterPage.vue')
|
|
|
},
|
|
|
{
|
|
|
@@ -220,17 +220,17 @@ const router = createRouter({
|
|
|
localStorage.removeItem('User');
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (publicPaths.includes(to.path)) return true;
|
|
|
-
|
|
|
+
|
|
|
if (!store.user?.role) {
|
|
|
return '/login';
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (to.meta?.roles && !to.meta.roles.includes(store.user.role)) {
|
|
|
return '/login';
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return true;
|
|
|
});
|
|
|
|