zhangjie 1 жил өмнө
parent
commit
d985d40ead

+ 2 - 1
src/api/markPage.ts

@@ -110,7 +110,8 @@ export async function changeUserInfo(name: string, password?: string) {
 
 /** 评卷用户退出 */
 export function doLogout() {
-  window.history.go(-1);
+  // window.history.go(-1);
+  window.close();
 }
 
 /** 评卷用户选择分组 */

+ 2 - 1
src/features/arbitrate/MarkHeader.vue

@@ -71,6 +71,7 @@
 
 <script setup lang="ts">
 import { store } from "@/store/store";
+import { doLogout } from "@/api/markPage";
 
 const { isSingleStudent = false } = defineProps<{
   isSingleStudent?: boolean;
@@ -81,6 +82,6 @@ const modeName = $computed(() =>
 );
 
 const logout = () => {
-  window.history.go(-1);
+  doLogout();
 };
 </script>

+ 2 - 1
src/features/check/ObjectiveAnswer.vue

@@ -183,6 +183,7 @@ import { useTimers } from "@/setups/useTimers";
 import { ArrowLeftOutlined, ArrowRightOutlined } from "@ant-design/icons-vue";
 import vls from "@/utils/storage";
 import { StudentObjectiveInfo } from "@/types";
+import { doLogout } from "@/api/markPage";
 
 const { addTimeout } = useTimers();
 
@@ -238,7 +239,7 @@ const answersComputed = $computed(() => {
 });
 
 function logout() {
-  window.history.go(-1);
+  doLogout();
 }
 
 async function getNextStudent() {

+ 2 - 2
src/features/check/SubjectiveAnswer.vue

@@ -108,7 +108,7 @@ import {
   studentSubjectiveConfirmData,
   saveStudentSubjectiveConfirmData,
 } from "@/api/checkPage";
-import { updateUISetting } from "@/api/markPage";
+import { doLogout, updateUISetting } from "@/api/markPage";
 import { store } from "@/store/store";
 import MarkTool from "../mark/MarkTool.vue";
 import MarkBody from "./MarkBody.vue";
@@ -145,7 +145,7 @@ onMounted(async () => {
 });
 
 const logout = () => {
-  window.history.go(-1);
+  doLogout();
 };
 
 async function getNextStudent() {

+ 2 - 1
src/features/student/studentTrack/StudentTrack.vue

@@ -47,11 +47,12 @@ import MarkBody from "../studentInspect/MarkBody.vue";
 import { message } from "ant-design-vue";
 import { getSingleStudentTaskOfStudentTrack } from "@/api/studentTrackPage";
 import vls from "@/utils/storage";
+import { doLogout } from "@/api/markPage";
 
 const studentId = $ref(vls.get("check-students", ""));
 
 function logout() {
-  window.history.go(-1);
+  doLogout();
 }
 
 async function updateTask() {

+ 1 - 1
src/main.ts

@@ -38,7 +38,7 @@ app.component("QmDialog", QmDialog);
  */
 initMarkStore();
 
-if (import.meta.env.DEV) {
+if (import.meta.env.DEV && window.localStorage.getItem("dev_simple")) {
   await import("./devLogin")
     .then((m) => {
       return m.initLogin();

+ 4 - 4
src/plugins/axiosNotice.ts

@@ -1,6 +1,6 @@
 import { throttle } from "lodash-es";
 import { message } from "ant-design-vue";
-// import { doLogout } from "@/api/markPage";
+import { doLogout } from "@/api/markPage";
 
 export const notifyInvalidTokenThrottled = throttle(
   () => {
@@ -8,9 +8,9 @@ export const notifyInvalidTokenThrottled = throttle(
       content: "登录失效,请重新登录!",
       duration: 10,
     });
-    // setTimeout(() => {
-    //   doLogout();
-    // }, 3000);
+    setTimeout(() => {
+      doLogout();
+    }, 3000);
     console.log("登录失效");
   },
   1000,