From 5f893929dadce0c1abcc4ee88dae56bf68bef8fd Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Fri, 5 May 2023 13:14:56 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=8F=8D=E5=90=91?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E5=81=9C=E7=94=A8=E6=97=A0=E6=B3=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=9A=84=E9=97=AE=E9=A2=98=20(#875)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/website.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 8e591eb7a..e99e94cc3 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -626,7 +626,6 @@ func (w WebsiteService) OpWebsiteHTTPS(ctx context.Context, req request.WebsiteH Name: "ssl_ciphers", }, ) - nginxParams = append(nginxParams) if err := deleteNginxConfig(constant.NginxScopeServer, nginxParams, &website); err != nil { return response.WebsiteHTTPS{}, err } @@ -1181,6 +1180,8 @@ func (w WebsiteService) OperateProxy(req request.WebsiteProxyConfig) (err error) if !fileOp.Stat(includePath) { _ = fileOp.CreateFile(includePath) } + backName := fmt.Sprintf("%s.bak", req.Name) + backPath := path.Join(includeDir, backName) defer func() { if err != nil { @@ -1210,15 +1211,12 @@ func (w WebsiteService) OperateProxy(req request.WebsiteProxyConfig) (err error) } case "delete": _ = fileOp.DeleteFile(includePath) + _ = fileOp.DeleteFile(backPath) return updateNginxConfig(constant.NginxScopeServer, nil, &website) case "disable": - backName := fmt.Sprintf("%s.bak", req.Name) - backPath := path.Join(includeDir, backName) _ = fileOp.Rename(includePath, backPath) return updateNginxConfig(constant.NginxScopeServer, nil, &website) case "enable": - backName := fmt.Sprintf("%s.bak", req.Name) - backPath := path.Join(includeDir, backName) _ = fileOp.Rename(backPath, includePath) return updateNginxConfig(constant.NginxScopeServer, nil, &website) }