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

Merge remote-tracking branch 'origin/master'

ZaiZai 1 жил өмнө
parent
commit
e54af071e8
1 өөрчлөгдсөн 8 нэмэгдсэн , 7 устгасан
  1. 8 7
      src/main.js

+ 8 - 7
src/main.js

@@ -31,8 +31,8 @@ const createWindow = () => {
 
 app.on('ready', () => {
     const filter = {urls: ['file:///C:/api/*', 'file:///api/*', 'file:///D:/api/*']};
-    //const url = 'http://127.0.0.1:8014'
-    const url = 'http://192.168.0.125:8014'
+    const url = 'http://127.0.0.1:8014'
+    //const url = 'http://192.168.0.125:8014'
     session.defaultSession.webRequest.onBeforeRequest(filter, (details, callback) => {
         const val = details.url
         let newUrl = val.replace('file:///api', url);
@@ -60,11 +60,12 @@ app.whenReady().then(() => {
 
     // 监听渲染进程发来的缓存清理完成的消息
     ipcMain.on('token-cache-cleared', () => {
-        console.log('token-cache-cleared')
-        if (mainWindow && !mainWindow.isDestroyed()) {
-            mainWindow.destroy();
-        }
-        app.quit();
+        setTimeout(() => {
+            if (mainWindow && !mainWindow.isDestroyed()) {
+                mainWindow.destroy();
+            }
+            app.quit();
+        },500)
     });
 })