Browse Source

退出调整 需要退到工作台的登录

dengshaobo 1 month ago
parent
commit
8e7d0dca52
2 changed files with 16 additions and 14 deletions
  1. 2 0
      src/views/exam/question.vue
  2. 14 14
      src/views/layout/components/header.vue

+ 2 - 0
src/views/exam/question.vue

@@ -322,6 +322,8 @@ const onTemplateChanged=(templateData: any)=>{
     console.log('模板更换成功', templateData)
     currentTemplateId.value = templateData.id
     currentTemplateName.value = templateData.templateName
+    // 更新 store 中的 templateId 并持久化到 localStorage
+    examStore.setExamInfo({ ...examStore.currentExam, templateId: templateData.id })
     // 重新获取模板信息(含题目起止范围)并刷新试题列表
     GetTemplateInfo()
     GetSmartQuestionList()

+ 14 - 14
src/views/layout/components/header.vue

@@ -156,21 +156,21 @@ const loginOutFn = async () => {
     localStorage.removeItem('token')
     localStorage.removeItem('userInfo')
     console.log("打印当前环境import.meta.env.MODE",import.meta.env.MODE);
-    //增加环境判断 
-    // if(import.meta.env.MODE == 'development') {
-    //   // window.location.href = 'http://localhost:8080'
-    //   router.push('/')
-    // }
-    // else if(import.meta.env.MODE == 'test')
-    // {
-    //   window.location.href = 'https://index.k12100.net'
-    // }
-    // else if(import.meta.env.MODE == 'production')
-    // {
-    //   window.location.href = 'https://www.k12100.com'
-    // }
+    // 增加环境判断 
+    if(import.meta.env.MODE == 'development') {
+      // window.location.href = 'http://localhost:8080'
+      router.push('/')
+    }
+    else if(import.meta.env.MODE == 'test')
+    {
+      window.location.href = 'https://index.k12100.net'
+    }
+    else if(import.meta.env.MODE == 'production')
+    {
+      window.location.href = 'https://www.k12100.com'
+    }
     
-    router.push('/login')
+    // router.push('/login')
   }else {
     ElMessage.error(res.msg)
   }