Răsfoiți Sursa

small improvement

Michael Wang 3 ani în urmă
părinte
comite
138feb0f59
3 a modificat fișierele cu 23 adăugiri și 10 ștergeri
  1. 8 0
      .editorconfig
  2. 14 10
      src/plugins/axiosNotice.ts
  3. 1 0
      tsconfig.json

+ 8 - 0
.editorconfig

@@ -0,0 +1,8 @@
+# http://editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+end_of_line = lf

+ 14 - 10
src/plugins/axiosNotice.ts

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

+ 1 - 0
tsconfig.json

@@ -7,6 +7,7 @@
     "strict": true,
     "jsx": "preserve",
     "sourceMap": true,
+    "isolatedModules": true,
     "resolveJsonModule": true,
     "esModuleInterop": true,
     "lib": ["esnext", "dom"],