chore(core): 使用path模块替代手动字符串拼接构造路径

This commit is contained in:
王立帮
2025-05-05 22:22:09 +08:00
parent aff8b8f21f
commit ef36a3fa55
3 changed files with 4 additions and 2 deletions

View File

@@ -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);
}
}

View File

@@ -1441,6 +1441,7 @@
{
"path": "/electron/loader.js",
"require": [
"path",
"Mixly.Url",
"Mixly.Config",
"Mixly.Env",

View File

@@ -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) => {