feat(frontend):添加设置导出导入功能

- 在 App.d.ts 中添加 ExportConfig 函数声明
- 在 app.go 中实现 ExportConfig 方法,用于导出配置文件
- 在 App.js 中添加 ExportConfig 函数的 JavaScript 调用接口
- 在 settings.vue 中添加导出和导入配置的功能按钮,并实现相关逻辑
- 在 settings_api.go 中添加 Export 方法,用于生成配置文件的 JSON 字符串
This commit is contained in:
spark 2025-02-10 09:47:10 +08:00
parent 3a3e0b0543
commit 3f73a5a521

1
app.go
View File

@ -535,6 +535,7 @@ func (a *App) ExportConfig() string {
file, err := runtime.SaveFileDialog(a.ctx, runtime.SaveDialogOptions{
Title: "导出配置文件",
CanCreateDirectories: true,
DefaultFilename: "config.json",
})
if err != nil {
logger.SugaredLogger.Errorf("导出配置文件失败:%s", err.Error())