fix: 导出时无需再去设置里面选择位置

This commit is contained in:
xuncha
2026-01-10 23:55:21 +08:00
parent 654eb40740
commit a1d11e4132
4 changed files with 71 additions and 61 deletions

View File

@@ -362,7 +362,26 @@ function ExportPage() {
<FolderOpen size={16} />
<span>{exportFolder || '未设置'}</span>
</div>
<p className="path-hint"></p>
<button
className="select-folder-btn"
onClick={async () => {
try {
const result = await window.electronAPI.dialog.openFile({
title: '选择导出目录',
properties: ['openDirectory']
})
if (!result.canceled && result.filePaths.length > 0) {
setExportFolder(result.filePaths[0])
await configService.setExportPath(result.filePaths[0])
}
} catch (e) {
console.error('选择目录失败:', e)
}
}}
>
<FolderOpen size={16} />
<span></span>
</button>
</div>
</div>