Эх сурвалжийг харах

fix nodeCheckRemoteDesktop error handle

Michael Wang 3 жил өмнө
parent
commit
38fdf1fc12

+ 21 - 6
src/features/UserLogin/useRemoteAppChecker.ts

@@ -47,13 +47,28 @@ export function useRemoteAppChecker() {
       return;
     }
 
-    const hasSun = nodeCheckRemoteDesktop();
-    if (hasSun) {
-      if (applicationNames) {
-        applicationNames += ",sunloginclient";
-      } else {
-        applicationNames = "sunloginclient";
+    try {
+      const hasSun = nodeCheckRemoteDesktop();
+      if (hasSun) {
+        if (applicationNames) {
+          applicationNames += ",sunloginclient";
+        } else {
+          applicationNames = "sunloginclient";
+        }
       }
+    } catch (error) {
+      logger({
+        cnl: ["local", "server"],
+        key: "nodeCheckRemoteDesktop",
+        pgu: "AUTO",
+        stk: error instanceof Error ? error.message : JSON.stringify(error),
+        dtl: "读取tasklist出错",
+        ext: { errorType: "e-01", applicationNames },
+      });
+      $message.error("系统检测出错(e-01),请退出程序后重试!", {
+        duration: 24 * 60 * 60 * 1000,
+      });
+      return;
     }
     if (!applicationNames?.trim()) {
       disableLoginBtnBecauseRemoteApp = false;