mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 09:13:49 +08:00
feat: 优化配置加载
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user