Browse Source

Update main.js

PUGE 8 months ago
parent
commit
819755defa
1 changed files with 7 additions and 1 deletions
  1. 7 1
      main.js

+ 7 - 1
main.js

@@ -159,6 +159,8 @@ app.whenReady().then(() => {
   if (webConfig.noCache) {
     console.log('无缓存模式!')
     webConfig.webPreferences.partition = 'persist:Session' + Math.round(Math.random()*100000)
+  } else {
+    webConfig.webPreferences.partition = 'persist:owoApp'
   }
   createWindow()
   
@@ -266,8 +268,12 @@ ipcMain.handle("openWindow", async (event, message) => {
   
   if (message.proxy) {
     // 获取对应 session
+    let partitionName = 'persist:owoApp'
+    if (webConfig.noCache) {
+      partitionName = 'persist:Session' + Math.round(Math.random()*100000)
+    }
     const customSession = session.fromPartition(partitionName);
-
+    
     // 设置代理(等待设置完成)
     await customSession.setProxy({
       proxyRules: message.proxy,