feat(UserEdit): 添加基建配置文件选择和导入功能

This commit is contained in:
2025-08-31 23:47:30 +08:00
parent c057c2ae21
commit 88374e5da4
2 changed files with 109 additions and 3 deletions

View File

@@ -111,13 +111,13 @@ ipcMain.handle('select-folder', async () => {
})
ipcMain.handle('select-file', async (event, filters = []) => {
if (!mainWindow) return null
if (!mainWindow) return []
const result = await dialog.showOpenDialog(mainWindow, {
properties: ['openFile'],
title: '选择文件',
filters: filters.length > 0 ? filters : [{ name: '所有文件', extensions: ['*'] }],
})
return result.canceled ? null : result.filePaths[0]
return result.canceled ? [] : result.filePaths
})
// 在系统默认浏览器中打开URL