From e3fcf9849e29b76da87963833074b50cedb22d49 Mon Sep 17 00:00:00 2001 From: Hanxven Date: Mon, 29 Jul 2024 12:55:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E7=9A=84?= =?UTF-8?q?=20Powershell=20=E8=84=9A=E6=9C=AC=E6=B7=BB=E5=8A=A0=20BOM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/main.ts | 1 - src/main/modules/akari-core/auto-update.ts | 10 +++++++--- .../components/settings-modal/AboutPane.vue | 2 +- .../toolkit/in-process/GameflowInProcess.vue | 16 +++++++++++++--- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index bd8c8a05..7f4ad585 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -10,7 +10,6 @@ import relativeTime from 'dayjs/plugin/relativeTime' import { app, dialog } from 'electron' import { configure } from 'mobx' import EventEmitter from 'node:events' -import path from 'node:path' import { setupLeagueAkariModules } from './modules' import { appModule } from './modules/akari-core/app' diff --git a/src/main/modules/akari-core/auto-update.ts b/src/main/modules/akari-core/auto-update.ts index c70ce24d..9227d203 100644 --- a/src/main/modules/akari-core/auto-update.ts +++ b/src/main/modules/akari-core/auto-update.ts @@ -181,11 +181,11 @@ export class AutoUpdateModule extends MobxBasedBasicModule { static DOWNLOAD_DIR_NAME = 'NewUpdates' static UPDATE_SCRIPT_NAME = 'LeagueAkariUpdate.ps1' static UPDATE_PROGRESS_UPDATE_INTERVAL = 200 - static FAKE_USER_AGENT = `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0 LeagueAkari/${app.getVersion()} ` + static USER_AGENT = `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0 LeagueAkari/${app.getVersion()} ` private _http = axios.create({ headers: { - 'User-Agent': AutoUpdateModule.FAKE_USER_AGENT + 'User-Agent': AutoUpdateModule.USER_AGENT } }) @@ -681,7 +681,11 @@ Try { ) const scriptPath = path.join(app.getPath('temp'), AutoUpdateModule.UPDATE_SCRIPT_NAME) - fs.writeFileSync(scriptPath, generatedPowershellScript) + + const bom = Buffer.from([0xef, 0xbb, 0xbf]) + const scriptFileWithBom = Buffer.concat([bom, Buffer.from(generatedPowershellScript, 'utf-8')]) + + fs.writeFileSync(scriptPath, scriptFileWithBom) this._logger.info(`写入更新脚本 ${scriptPath}`) diff --git a/src/renderer/src-main-window/components/settings-modal/AboutPane.vue b/src/renderer/src-main-window/components/settings-modal/AboutPane.vue index d29f7ed5..7bbf7845 100644 --- a/src/renderer/src-main-window/components/settings-modal/AboutPane.vue +++ b/src/renderer/src-main-window/components/settings-modal/AboutPane.vue @@ -112,7 +112,7 @@ - 回到房间 + + 退出房间 +