Przeglądaj źródła

增加线上地址

duy 2 miesięcy temu
rodzic
commit
8bb54d2f8b
3 zmienionych plików z 9 dodań i 9 usunięć
  1. 3 3
      electron.vite.config.mjs
  2. 5 5
      src/main/index.js
  3. 1 1
      src/renderer/index.html

+ 3 - 3
electron.vite.config.mjs

@@ -34,9 +34,9 @@ export default defineConfig({
                 '/api': {
                 '/api': {
                     ws: true,
                     ws: true,
                     changeOrigin: true,
                     changeOrigin: true,
-                    //target: 'http://127.0.0.1:8014',
-                    target: 'http://192.168.0.109:8014',
-                    // target: 'http://219.151.181.73:8014',
+                    // target: 'https://127.0.0.1:8014',
+                    // target: 'http://192.168.0.109:8014',
+                    target: 'http://219.151.181.73:8014',
                         //    target: 'http://192.168.0.21:8014',
                         //    target: 'http://192.168.0.21:8014',
                     rewrite: (path) => path.replace(new RegExp('^/api'), '/'),
                     rewrite: (path) => path.replace(new RegExp('^/api'), '/'),
                 },
                 },

+ 5 - 5
src/main/index.js

@@ -68,7 +68,7 @@ function createWindow() {
             webviewTag: true,
             webviewTag: true,
             nodeIntegration: true,
             nodeIntegration: true,
             contextIsolation: true,
             contextIsolation: true,
-            webSecurity: true,
+          
         },
         },
     })
     })
 
 
@@ -103,7 +103,7 @@ function createWindow() {
                     + 'script-src \'self\' \'unsafe-inline\' \'unsafe-eval\'; '
                     + 'script-src \'self\' \'unsafe-inline\' \'unsafe-eval\'; '
                     + 'style-src \'self\' \'unsafe-inline\'; '
                     + 'style-src \'self\' \'unsafe-inline\'; '
                     + 'img-src \'self\' data: blob: https:; '
                     + 'img-src \'self\' data: blob: https:; '
-                    + 'connect-src \'self\' https: ws: wss:; '
+                    + 'connect-src \'self\' http://127.0.0.1:8014 http://192.168.0.109:8014 http://219.151.181.73:8014 https: ws: wss:; '
                     + 'font-src \'self\' data:;',
                     + 'font-src \'self\' data:;',
                 ],
                 ],
             },
             },
@@ -115,9 +115,9 @@ function setupWebRequestFilter() {
     const filter = {
     const filter = {
         urls: ['file:///C:/api/*', 'file:///api/*', 'file:///D:/api/*'],
         urls: ['file:///C:/api/*', 'file:///api/*', 'file:///D:/api/*'],
     }
     }
-    //const url = 'http://127.0.0.1:8014'
-        const url = 'http://192.168.0.109:8014'
-    // const url = 'http://219.151.181.73:8014'
+    // const url = 'http://127.0.0.1:8014'
+        // const url = 'http://192.168.0.109:8014'
+    const url = 'http://219.151.181.73:8014'
             // const url = 'http://192.168.0.21:8014'
             // const url = 'http://192.168.0.21:8014'
     session.defaultSession.webRequest.onBeforeRequest(
     session.defaultSession.webRequest.onBeforeRequest(
         filter,
         filter,

+ 1 - 1
src/renderer/index.html

@@ -4,7 +4,7 @@
         <meta charset="UTF-8" />
         <meta charset="UTF-8" />
         <meta http-equiv="Cache-control" content="no-cache">
         <meta http-equiv="Cache-control" content="no-cache">
         <meta name="viewport" content="width=device-width, initial-scale=1.0" />
         <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-        <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; connect-src 'self' http://127.0.0.1:8014 http://192.168.0.109:8014 ws: wss:; img-src 'self' data: https:; font-src 'self' data:;">
+        <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; connect-src 'self' http://127.0.0.1:8014 http://192.168.0.109:8014 http://219.151.181.73:8014 ws: wss:; img-src 'self' data: https:; font-src 'self' data:;">
         
         
     </head>
     </head>
     <body>
     <body>