mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 16:10:59 +08:00
refactor: 重构 tools.Read 函数
This commit is contained in:
@@ -103,8 +103,8 @@ func (r *Postgresql15Controller) GetConfig(ctx http.Context) http.Response {
|
||||
}
|
||||
|
||||
// 获取配置
|
||||
config := tools.Read("/www/server/postgresql/data/postgresql.conf")
|
||||
if len(config) == 0 {
|
||||
config, err := tools.Read("/www/server/postgresql/data/postgresql.conf")
|
||||
if err != nil {
|
||||
return controllers.Error(ctx, http.StatusInternalServerError, "获取PostgreSQL配置失败")
|
||||
}
|
||||
|
||||
@@ -119,8 +119,8 @@ func (r *Postgresql15Controller) GetUserConfig(ctx http.Context) http.Response {
|
||||
}
|
||||
|
||||
// 获取配置
|
||||
config := tools.Read("/www/server/postgresql/data/pg_hba.conf")
|
||||
if len(config) == 0 {
|
||||
config, err := tools.Read("/www/server/postgresql/data/pg_hba.conf")
|
||||
if err != nil {
|
||||
return controllers.Error(ctx, http.StatusInternalServerError, "获取PostgreSQL配置失败")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user