From 83210f7c6c65eaf91170ec58a64f8386ab6fbaa1 Mon Sep 17 00:00:00 2001 From: Jacky Date: Mon, 29 Mar 2021 20:37:18 +0800 Subject: [PATCH] bug fix --- nginx-ui-frontend/version.json | 2 +- server/api/domain.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nginx-ui-frontend/version.json b/nginx-ui-frontend/version.json index 081d9bc2..09ae2bb4 100644 --- a/nginx-ui-frontend/version.json +++ b/nginx-ui-frontend/version.json @@ -1 +1 @@ -{"version":"0.1.0","build_id":21} \ No newline at end of file +{"version":"0.1.0","build_id":22} \ No newline at end of file diff --git a/server/api/domain.go b/server/api/domain.go index bae41f12..59e10015 100644 --- a/server/api/domain.go +++ b/server/api/domain.go @@ -97,15 +97,15 @@ func EditDomain(c *gin.Context) { err = c.BindJSON(&request) path := filepath.Join(tool.GetNginxConfPath("sites-available"), name) - /*if _, err = os.Stat(path); err == nil { + if _, err = os.Stat(path); err == nil { origContent, err = ioutil.ReadFile(path) if err != nil { ErrorHandler(c, err) return } - }*/ + } - if request["content"] != "" /*&& request["content"] != string(origContent)*/ { + if request["content"] != "" && request["content"] != string(origContent) { // model.CreateBackup(path) err := ioutil.WriteFile(path, []byte(request["content"].(string)), 0644) if err != nil {