From 88374e5da4e69ce880c57cb8c744e02f7fbd12e8 Mon Sep 17 00:00:00 2001 From: AoXuan Date: Sun, 31 Aug 2025 23:47:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(UserEdit):=20=E6=B7=BB=E5=8A=A0=E5=9F=BA?= =?UTF-8?q?=E5=BB=BA=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=92=8C=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/electron/main.ts | 4 +- frontend/src/views/UserEdit.vue | 108 +++++++++++++++++++++++++++++++- 2 files changed, 109 insertions(+), 3 deletions(-) diff --git a/frontend/electron/main.ts b/frontend/electron/main.ts index 8580a50..07eb02a 100644 --- a/frontend/electron/main.ts +++ b/frontend/electron/main.ts @@ -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 diff --git a/frontend/src/views/UserEdit.vue b/frontend/src/views/UserEdit.vue index 5fd2c98..fb9e6f1 100644 --- a/frontend/src/views/UserEdit.vue +++ b/frontend/src/views/UserEdit.vue @@ -250,6 +250,52 @@ + + + + + +
+ + + 选择文件 + + + 导入配置 + +
+
+ 请选择有效的基建配置JSON文件,点击"导入配置"按钮将其应用到当前用户。如果已经导入,可以忽略此选择框。 +
+
+
+
+