2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 09:13:49 +08:00

feat: 优化配置加载

This commit is contained in:
耗子
2024-10-10 21:14:54 +08:00
parent e02de8ba05
commit d31f40f2dc
5 changed files with 80 additions and 9 deletions

View File

@@ -122,7 +122,7 @@ func (r *settingRepo) UpdatePanelSetting(ctx context.Context, setting *request.P
restartFlag := false
config := new(types.PanelConfig)
cm := yaml.CommentMap{}
raw, err := io.Read("config/config.yml")
raw, err := io.Read(filepath.Join(app.Root, "panel/config/config.yml"))
if err != nil {
return false, err
}
@@ -139,7 +139,7 @@ func (r *settingRepo) UpdatePanelSetting(ctx context.Context, setting *request.P
if err != nil {
return false, err
}
if err = io.Write("config/config.yml", string(encoded), 0644); err != nil {
if err = io.Write(filepath.Join(app.Root, "panel/config/config.yml"), string(encoded), 0644); err != nil {
return false, err
}
if raw != string(encoded) {