Ver Fonte

fix:修复了开始作业无法跳转的问题

LiaoYanZhou há 9 meses atrás
pai
commit
55716042fa
2 ficheiros alterados com 26 adições e 15 exclusões
  1. 15 15
      src/router/index.ts
  2. 11 0
      src/views/HomeworkPage/component/HomeworkDetail.vue

+ 15 - 15
src/router/index.ts

@@ -16,24 +16,24 @@ const router = createRouter({
     },
 
     // 登录与注册
-    // {
-    //   path: "/",
-    //   redirect: () => {
-    //     // window.location.href = "https://p-nju.seec.seecoder.cn/login?from=http://127.0.0.1:4000";
-    //     window.location.href = "http://localhost:4000/login";
-    //     // {本地门户首页地址}?from={本地eai首页地址}
-    //     return "/"; // 占位返回值,实际不会执行
-    // },
-    // },
     {
       path: "/",
-      redirect: "/login"
+      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";
+        // {本地门户首页地址}?from={本地eai首页地址}
+        return "/"; // 占位返回值,实际不会执行
     },
-    {
-      path: '/login',
-      name: 'login',
-      component: () => import('../views/LoginPage/LoginPage.vue')
     },
+    // {
+    //   path: "/",
+    //   redirect: "/login"
+    // },
+    // {
+    //   path: '/login',
+    //   name: 'login',
+    //   component: () => import('../views/LoginPage/LoginPage.vue')
+    // },
     {
       path: '/register',
       name: 'register',
@@ -260,7 +260,7 @@ const router = createRouter({
  */
   router.beforeEach(async (to) => {
     const store = useStore();
-    const publicPaths = [ '/register', '/passwordChange', '/login',];
+    const publicPaths = [ '/register', '/passwordChange', '/admin/login',];
     // 1. 检查URL中的token
     const urlToken = new URLSearchParams(window.location.search).get('token');
     if (urlToken) {

+ 11 - 0
src/views/HomeworkPage/component/HomeworkDetail.vue

@@ -176,6 +176,17 @@ function handleStart(){
                 })
               })
         }
+        else{
+          if(data.type == 'writing' || data.type == '写作'){
+            router.push(`/home/assignment/${assignmentId}/edit`).then(() => {
+              window.location.reload()
+            })
+          } else if(data.type == 'speaking' || data.type == 'AI口语'){
+            router.push(`/home/assignment/${assignmentId}/aispeaking`).then(() => {
+              window.location.reload()
+            })
+          }
+        }
       }).catch((_err:any) => {
     console.log(_err)
   })