瀏覽代碼

Merge branch 'feature/behavior_record' of FanYanPeng/EAIFrontend into host-nju

LiaoYanZhou 1 年之前
父節點
當前提交
8a1730aec1
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/router/index.ts

+ 2 - 2
src/router/index.ts

@@ -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';
     }