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