|
|
@@ -19,8 +19,8 @@ const router = createRouter({
|
|
|
{
|
|
|
path: "/",
|
|
|
redirect: () => {
|
|
|
- window.location.href = "https://p-nju.seec.seecoder.cn/login?from=https://air-nju.seec.seecoder.cn";
|
|
|
- // window.location.href = "http://localhost:8000/login?from=http://localhost:4000";
|
|
|
+ // window.location.href = "https://p-nju.seec.seecoder.cn/login?from=https://air-nju.seec.seecoder.cn";
|
|
|
+ window.location.href = "http://localhost:8000/login?from=http://localhost:4000";
|
|
|
// {本地门户首页地址}?from={本地eai首页地址}
|
|
|
return "/"; // 占位返回值,实际不会执行
|
|
|
},
|
|
|
@@ -260,7 +260,7 @@ const router = createRouter({
|
|
|
*/
|
|
|
router.beforeEach(async (to) => {
|
|
|
const store = useStore();
|
|
|
- const publicPaths = [ '/register', '/passwordChange', '/admin/login','];
|
|
|
+ const publicPaths = [ '/register', '/passwordChange', '/admin/login',];
|
|
|
// 1. 检查URL中的token
|
|
|
const urlToken = new URLSearchParams(window.location.search).get('token');
|
|
|
if (urlToken) {
|
|
|
@@ -298,7 +298,7 @@ const router = createRouter({
|
|
|
return '/';
|
|
|
}
|
|
|
|
|
|
- if (to.meta?.roles && !to.meta.roles.includes(store.user.role)) {
|
|
|
+ if (to.meta?.roles && !(to.meta.roles as any[]).includes(store.user.role)) {
|
|
|
return '/home';
|
|
|
}
|
|
|
|