From ffe62b8f8e74843b43200893b7afcd226c0e6185 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sat, 25 Dec 2021 15:19:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=96=B0?= =?UTF-8?q?=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/build.js | 8 +++- electron/index.html | 57 ----------------------- resources/assets/js/pages/manage/file.vue | 2 +- 3 files changed, 8 insertions(+), 59 deletions(-) diff --git a/electron/build.js b/electron/build.js index 05ba3dbf..72a795fa 100644 --- a/electron/build.js +++ b/electron/build.js @@ -106,6 +106,7 @@ const platform = ["build-mac", "build-mac-arm", "build-win"]; // 生成配置、编译应用 function step1(data, publish) { + // config.js let systemInfo = { title: data.name, version: config.version, @@ -115,7 +116,12 @@ function step1(data, publish) { fs.writeFileSync(electronDir + "/config.js", "window.systemInformation = " + JSON.stringify(systemInfo), 'utf8'); fs.writeFileSync(nativeCachePath, formatUrl(data.url)); fs.writeFileSync(devloadCachePath, "", 'utf8'); - // + // index.html + let indexFile = path.resolve(electronDir, "index.html"); + let indexString = fs.readFileSync(indexFile, 'utf8'); + indexString = indexString.replace(``, `${data.name}`); + fs.writeFileSync(indexFile, indexString, 'utf8'); + // package.json let packageFile = path.resolve(__dirname, "package.json"); let packageString = fs.readFileSync(packageFile, 'utf8'); packageString = packageString.replace(/"name":\s*"(.*?)"/, `"name": "${data.name}"`); diff --git a/electron/index.html b/electron/index.html index 0128ca85..dcaadc04 100644 --- a/electron/index.html +++ b/electron/index.html @@ -1,4 +1,3 @@ - @@ -15,62 +14,6 @@ - diff --git a/resources/assets/js/pages/manage/file.vue b/resources/assets/js/pages/manage/file.vue index 5766be32..e13af80c 100644 --- a/resources/assets/js/pages/manage/file.vue +++ b/resources/assets/js/pages/manage/file.vue @@ -654,7 +654,7 @@ export default { }, openSingle(item) { - let url = $A.originUrl("index.html/#/single/file/" + item.id + "?title=" + encodeURIComponent(item.name)), + let url = $A.originUrl("index.html#/single/file/" + item.id), name = 'file-' + item.id, width = Math.min(window.screen.availWidth, 1280), height = Math.min(window.screen.availHeight, 800);