From 1aded1d50a4a4b5103ea66c1b727d2bafab0e22a Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Wed, 14 Aug 2024 15:45:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=AD=E6=96=87=E7=9B=AE=E5=BD=95=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=96=87=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/file.js | 2 +- src/main/index.js | 5 +++++ src/renderer/src/views/prepare/container/file-list-item.vue | 1 + src/renderer/src/views/prepare/index.vue | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/file.js b/src/main/file.js index d3eede2..348c703 100644 --- a/src/main/file.js +++ b/src/main/file.js @@ -146,7 +146,7 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { //使用默认应用打开本地文件 ipcMain.on('open-path-app', (e, destination) => { let path = appRootFilePath + destination - shell.openExternal(path).catch((error) => { + shell.openPath(path).catch((error) => { console.log(error) }) }) diff --git a/src/main/index.js b/src/main/index.js index d5e6f75..c90837e 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -28,6 +28,7 @@ function createLoginWindow() { icon: join(__dirname, '../../resources/logo2.ico'), ...(process.platform === 'linux' ? { icon } : {}), webPreferences: { + defaultEncoding: 'utf-8', preload: join(__dirname, '../preload/index.js'), sandbox: false, nodeIntegration: true, @@ -67,6 +68,7 @@ function createMainWindow() { icon: join(__dirname, '../../resources/logo2.ico'), ...(process.platform === 'linux' ? { icon } : {}), webPreferences: { + defaultEncoding: 'utf-8', preload: join(__dirname, '../preload/index.js'), sandbox: false, // nodeIntegration: true, @@ -115,6 +117,7 @@ async function createLinkWin(data) { autoHideMenuBar: true, ...(process.platform === 'linux' ? { icon } : {}), webPreferences: { + defaultEncoding: 'utf-8', sandbox: false, nodeIntegration: true, worldSafeExecuteJavaScript: true, @@ -143,6 +146,8 @@ async function createLinkWin(data) { // 初始化完成 app.on('ready', () => { + process.env.LANG = 'en_US.UTF-8' + process.env['ELECTRON_DISABLE_SANDBOX'] = true; // 设置应用程序用户模型标识符 electronApp.setAppUserModelId('com.electron') diff --git a/src/renderer/src/views/prepare/container/file-list-item.vue b/src/renderer/src/views/prepare/container/file-list-item.vue index 92bc0af..73f4091 100644 --- a/src/renderer/src/views/prepare/container/file-list-item.vue +++ b/src/renderer/src/views/prepare/container/file-list-item.vue @@ -230,6 +230,7 @@ export default { } }, openFileWin(items) { + if (!items||!items.fileSuffix) return; getPrepareById(items.id).then((item) => { Object.assign(items, item) asyncLocalFile(items).then(() => { diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index ea7cbcc..b8ef497 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -414,6 +414,7 @@ export default { this.curBookImg = data.textBook.curBookImg this.curBookPath = data.textBook.curBookPath this.checkFileList = [] + this.currentWorkList = [] let cata = parseCataByNode(data.node) this.currentNode = data.node this.uploadData.levelFirstId = cata[0] From 1e52abc17092fda74c0fc2895270742c395f6544 Mon Sep 17 00:00:00 2001 From: yangws <1607839436@qq.com> Date: Wed, 14 Aug 2024 15:58:06 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E6=96=B0=E5=8A=A0=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E4=BF=AE=E6=94=B9=E5=AD=A6=E6=AE=B5;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/choose-textbook/index.vue | 17 +++--- src/renderer/src/views/profile/userInfo.vue | 53 +++++++++++++++---- 2 files changed, 51 insertions(+), 19 deletions(-) diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index bdd14b9..9c02172 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -42,7 +42,7 @@ From 3c2dbb722a9f5b0ad08305f55d6b1887a2320555 Mon Sep 17 00:00:00 2001 From: yangws <1607839436@qq.com> Date: Wed, 14 Aug 2024 16:31:30 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=E4=B8=8A=E4=BC=A0=E5=AD=98=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E8=B7=AF=E5=BE=84;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/profile/userInfo.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/src/views/profile/userInfo.vue b/src/renderer/src/views/profile/userInfo.vue index 5358e00..de7ea81 100644 --- a/src/renderer/src/views/profile/userInfo.vue +++ b/src/renderer/src/views/profile/userInfo.vue @@ -126,6 +126,7 @@ setTimeout(() => { function submit() { proxy.$refs.userRef.validate((valid) => { if (valid) { + props.user.avatar = userStore.user.avatar updateUserInfo(props.user).then((response) => { if(response.code == 200){ userStore.login({username:props.user.phonenumber,password:props.user.plainpwd}).then(() => {