Ver Fonte

补充日志channel

Michael Wang há 3 anos atrás
pai
commit
a10c73c070

+ 5 - 1
src/features/UserLogin/UserLogin.vue

@@ -8,7 +8,11 @@ import { store } from "@/store/store";
 import { createUserDetailLog } from "@/utils/logger";
 import { useRouter } from "vue-router";
 
-logger({ cnl: ["console"], pgn: "登录页面", act: "首次渲染" });
+logger({
+  cnl: ["console", "local", "server"],
+  pgn: "登录页面",
+  act: "首次渲染",
+});
 
 const accountType = $ref("STUDENT_CODE");
 const accountValue = $ref("");

+ 1 - 1
src/plugins/axiosNotice.ts

@@ -7,7 +7,7 @@ export const notifyInvalidTokenThrottled = throttle(
     setTimeout(() => {
       store.user.token = null;
     }, 3000);
-    logger({ pgu: "AUTO", dtl: "登录失效" });
+    logger({ pgu: "AUTO", cnl: ["console", "server"], dtl: "登录失效" });
   },
   1000,
   { trailing: false }

+ 1 - 0
src/utils/nativeExe.ts

@@ -22,6 +22,7 @@ export default function checkRemote(
           console.log(exeName, err, data); // 未免过多日志,此处后续可以关闭
           logger({
             pgu: "AUTO",
+            cnl: ["console", "local", "server"],
             act: exeName + " called",
             ejn: JSON.stringify(err),
             dtl: data,

+ 3 - 0
src/utils/tryLimit.ts

@@ -20,6 +20,7 @@ export async function tryLimit({
 
     logger({
       key: "请求限流",
+      cnl: ["server"],
       act: "第一次限流调用",
       dtl: serverPass ? "进入" : "限流",
       ext: { limitAction: action },
@@ -39,6 +40,7 @@ export async function tryLimit({
       serverPass = res.data.pass;
       logger({
         key: "请求限流",
+        cnl: ["server"],
         act: "限流后自动重试",
         dtl: serverPass ? "进入" : "依然限流",
         ext: { limitAction: action },
@@ -48,6 +50,7 @@ export async function tryLimit({
     console.log(error);
     logger({
       key: "请求限流",
+      cnl: ["server"],
       act: "限流请求失败",
       ejn: JSON.stringify(error),
       ext: { limitAction: action },