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:
@@ -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 端口失败")
|
||||
|
||||
Reference in New Issue
Block a user