From 7dd257aa68e26f81888c6c7da7aa788fa90cca94 Mon Sep 17 00:00:00 2001 From: yonghang <1251679661@qq.com> Date: Wed, 14 Aug 2024 16:45:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=A1=8C=E9=9D=A2=E7=A8=8B=E5=BA=8F=E4=B8=ADpreload.js?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=E5=AF=BC=E8=87=B4=E8=AE=B0=E4=BD=8F?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E5=A4=8D=E9=80=89=E6=A1=86=E5=A7=8B=E7=BB=88?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++++ main.js | 1 + package.json | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3c3629e..6f2a7b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ node_modules + +dist/ +out/ +*.lock diff --git a/main.js b/main.js index 4791600..824c21b 100644 --- a/main.js +++ b/main.js @@ -11,6 +11,7 @@ function createWindow () { // frame: false, icon: path.join(__dirname, 'icon.ico'), webPreferences: { + contextIsolation: false, preload: path.join(__dirname, 'preload.js'), webSecurity: false, // 允许跨域 } diff --git a/package.json b/package.json index 6357d28..b2a8e02 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "main.js", "scripts": { "start": "electron .", - "packager": "electron-packager ./ cas-w --platform=win32 --arch=x64 --overwrite --icon=./icon.ico --out=./out" + "packager": "electron-packager ./ cas-w --platform=win32 --arch=x64 --download.mirrorOptions.mirror=https://npmmirror.com/mirrors/electron/ --overwrite --icon=./icon.ico --out=./out" }, "win": {