Michael Wang %!s(int64=3) %!d(string=hai) anos
pai
achega
82c97b3db8
Modificáronse 3 ficheiros con 10 adicións e 6 borrados
  1. 5 1
      src/utils/electronLog.js
  2. 2 3
      src/utils/logger.js
  3. 3 2
      src/utils/nativeExe.js

+ 5 - 1
src/utils/electronLog.js

@@ -64,7 +64,11 @@ if (isElectron) {
       // originalConsoleLog(bufView);
       log.info(">>==>>" + window.btoa(ab2str(encryMsg)) + "<<==<<");
     }
-    originalConsoleLog.call(window, ...args);
+    try {
+      originalConsoleLog.call(window, ...args);
+    } catch (error) {
+      console.debug(error);
+    }
   };
 }
 

+ 2 - 3
src/utils/logger.js

@@ -92,12 +92,11 @@ export function createEncryptLog() {
   try {
     const user = store.state.user;
     const uuidForEcs = localStorage.getItem("uuidForEcs");
-    if (uuidForEcs) {
-      logger.push("uuidForEcs", uuidForEcs);
-    } else {
+    if (!uuidForEcs) {
       // 没有 uuidForEcs 日志没法查询
       return;
     }
+    logger.push("uuidForEcs", uuidForEcs);
     if (user) {
       logger.push("userId", user.id);
     }

+ 3 - 2
src/utils/nativeExe.js

@@ -105,7 +105,8 @@ export function nodeCheckProcess() {
       .nodeRequire("child_process")
       .execSync("cmd /c chcp 65001>nul && tasklist /FO CSV")
       .toString();
-    console.log(appList);
+    // 不能打印,electron-log 不能接收
+    // console.log(appList);
     appList = appList.split("\r\n");
     appList.shift();
     appList = appList.map((v) => v.split(",")[0]);
@@ -114,7 +115,7 @@ export function nodeCheckProcess() {
       createLog({
         page: window.location.pathname,
         action: "nodeCheckProcess",
-        xorRes,
+        xorRes: xorRes.join(" ||| "),
       });
     }
     previousAppList = appList;