Skip to content

Commit

Permalink
Merge pull request #207 from hjdhnx/main
Browse files Browse the repository at this point in the history
修复写源工具导出文件
  • Loading branch information
Hiram-Wong authored May 14, 2024
2 parents 28f0385 + 92de66f commit ed81ddb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/main/core/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/src/pages/setting/tool/EditSource.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ed81ddb

Please sign in to comment.