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

refactor: 重构 tools.Write 函数

This commit is contained in:
耗子
2023-11-12 03:02:45 +08:00
parent 46e027b18c
commit ac420debbb
23 changed files with 591 additions and 1957 deletions

View File

@@ -66,8 +66,7 @@ func (r *PhpMyAdminController) SetPort(ctx http.Context) http.Response {
conf := tools.Read("/www/server/vhost/phpmyadmin.conf")
conf = regexp.MustCompile(`listen\s+(\d+);`).ReplaceAllString(conf, "listen "+port+";")
err := tools.Write("/www/server/vhost/phpmyadmin.conf", conf, 0644)
if err != nil {
if err := tools.Write("/www/server/vhost/phpmyadmin.conf", conf, 0644); err != nil {
facades.Log().Request(ctx.Request()).Tags("插件", "phpMyAdmin").With(map[string]any{
"error": err.Error(),
}).Info("修改 phpMyAdmin 端口失败")