Browse Source

防止 remoteApplication.txt 被设置为只读

Michael Wang 3 years ago
parent
commit
52368a9e15
2 changed files with 12 additions and 0 deletions
  1. 6 0
      src/features/Login/Login.vue
  2. 6 0
      src/features/OnlineExam/Examing/ExamingHome.vue

+ 6 - 0
src/features/Login/Login.vue

@@ -973,6 +973,12 @@ export default {
           const remoteAppName = REMOTE_APP_NAME;
           exe = `Project2.exe "${remoteAppName}" `;
         }
+        const fs = window.nodeRequire("fs");
+        try {
+          fs.unlinkSync("remoteApplication.txt");
+        } catch (error) {
+          console.log(error);
+        }
         await nativeExe(exe, checkRemoteAppTxt.bind(this));
       } else {
         this.disableLoginBtnBecauseRemoteApp = false;

+ 6 - 0
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -1085,6 +1085,12 @@ export default {
           const remoteAppName = REMOTE_APP_NAME;
           exe = `Project2.exe "${remoteAppName}" `;
         }
+        const fs = window.nodeRequire("fs");
+        try {
+          fs.unlinkSync("remoteApplication.txt");
+        } catch (error) {
+          console.log(error);
+        }
         await nativeExe(exe, checkRemoteAppTxt.bind(this));
       } else {
         this.disableExamingBecauseRemoteApp = false;