From ef36a3fa55523c941e18d8841747ea500e8fd557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Mon, 5 May 2025 22:22:09 +0800 Subject: [PATCH] =?UTF-8?q?chore(core):=20=E4=BD=BF=E7=94=A8path=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=9B=BF=E4=BB=A3=E6=89=8B=E5=8A=A8=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E6=8B=BC=E6=8E=A5=E6=9E=84=E9=80=A0=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/modules/mixly-modules/common/app.js | 2 +- common/modules/mixly-modules/deps.json | 1 + common/modules/mixly-modules/electron/loader.js | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/modules/mixly-modules/common/app.js b/common/modules/mixly-modules/common/app.js index b4cfd2df..23f306f5 100644 --- a/common/modules/mixly-modules/common/app.js +++ b/common/modules/mixly-modules/common/app.js @@ -661,7 +661,7 @@ class App extends Component { if (goog.isElectron) { Loader.onbeforeunload(); } else { - let href = Env.srcDirPath + '/index.html?' + Url.jsonToUrl({ boardType: BOARD.boardType }); + let href = path.join(Env.srcDirPath, 'index.html') + '?' + Url.jsonToUrl({ boardType: BOARD.boardType }); window.location.replace(href); } } diff --git a/common/modules/mixly-modules/deps.json b/common/modules/mixly-modules/deps.json index 32f22a38..9b187ec7 100644 --- a/common/modules/mixly-modules/deps.json +++ b/common/modules/mixly-modules/deps.json @@ -1441,6 +1441,7 @@ { "path": "/electron/loader.js", "require": [ + "path", "Mixly.Url", "Mixly.Config", "Mixly.Env", diff --git a/common/modules/mixly-modules/electron/loader.js b/common/modules/mixly-modules/electron/loader.js index afb1e557..47d07be9 100644 --- a/common/modules/mixly-modules/electron/loader.js +++ b/common/modules/mixly-modules/electron/loader.js @@ -1,5 +1,6 @@ goog.loadJs('electron', () => { +goog.require('path'); goog.require('Mixly.Url'); goog.require('Mixly.Config'); goog.require('Mixly.Env'); @@ -32,7 +33,7 @@ Loader.onbeforeunload = function(reload = false) { window.location.reload(true); } } - let href = Env.srcDirPath + '/index.html?' + Url.jsonToUrl({ boardType: BOARD.boardType ?? 'None' }); + let href = path.join(Env.srcDirPath, 'index.html') + '?' + Url.jsonToUrl({ boardType: BOARD.boardType ?? 'None' }); let endPromise = []; const { mainStatusBarTabs } = Mixly; Serial.getCurrentPortsName().map((name) => {