From 92de66f47ee6bde4473c1492ec1cb3731e574712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=9A=E9=A3=8E=E6=8B=82=E6=9F=B3=E9=A2=9C?= <434857005@qq.com> Date: Wed, 15 May 2024 01:39:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=86=99=E6=BA=90=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E5=AF=BC=E5=87=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/core/ipc.ts | 4 ++++ src/renderer/src/pages/setting/tool/EditSource.vue | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/core/ipc.ts b/src/main/core/ipc.ts index 741de4d4f..805fb439c 100644 --- a/src/main/core/ipc.ts +++ b/src/main/core/ipc.ts @@ -159,6 +159,10 @@ const ipcListen = () => { return path; }); + ipcMain.handle('path-join', (event, fromPath, toPath) => { + return join(fromPath, toPath); + }); + // 重启app ipcMain.on('relaunch-app', () => { app.relaunch(); diff --git a/src/renderer/src/pages/setting/tool/EditSource.vue b/src/renderer/src/pages/setting/tool/EditSource.vue index cd39e1ca7..77d016204 100644 --- a/src/renderer/src/pages/setting/tool/EditSource.vue +++ b/src/renderer/src/pages/setting/tool/EditSource.vue @@ -660,8 +660,9 @@ const exportFileEvent = async () => { await window.electron.ipcRenderer.send('tmpdir-manage', 'init', 'file/js'); const userDataPath = await window.electron.ipcRenderer.invoke('read-path', 'userData'); - const defaultPath = `${userDataPath}/file/js/${title}.js` - console.log(`[EditSource][exportFileEvent]peth:${defaultPath}`); + const defaultPath = await window.electron.ipcRenderer.invoke('path-join', userDataPath, `file/js/${title}.js`); + // const defaultPath = `${userDataPath}/file/js/${title}.js`; + console.log(`[EditSource][exportFileEvent]path:${defaultPath}`); const { canceled, filePath } = await remote.dialog.showSaveDialog(remote.getCurrentWindow(), { defaultPath,