feat(config): 支持完整配置导入导出

This commit is contained in:
上玄
2026-08-12 09:34:02 +08:00
parent 988ba63d40
commit 3fc04eeb4f
17 changed files with 1047 additions and 91 deletions
+12
View File
@@ -17,6 +17,12 @@ func (s *ProxyService) LoadUserConfig() (UserConfig, error) {
if s == nil {
return serverconfig.DefaultConfig(), nil
}
s.configMu.Lock()
defer s.configMu.Unlock()
return s.loadUserConfig()
}
func (s *ProxyService) loadUserConfig() (UserConfig, error) {
app := application.Get()
ctx := context.Background()
if app != nil {
@@ -36,6 +42,12 @@ func (s *ProxyService) SaveUserConfig(cfg UserConfig) error {
if s == nil {
return nil
}
s.configMu.Lock()
defer s.configMu.Unlock()
return s.saveUserConfig(cfg)
}
func (s *ProxyService) saveUserConfig(cfg UserConfig) error {
app := application.Get()
ctx := context.Background()
if app != nil {