From 9fa04c9a907f01b5db523e4aa8d1831a972956ec Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 25 Dec 2024 15:58:07 +0800 Subject: [PATCH] Update site.py --- web/utils/site.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/utils/site.py b/web/utils/site.py index 667b9ce37..20eba70e8 100644 --- a/web/utils/site.py +++ b/web/utils/site.py @@ -978,15 +978,15 @@ class sites(object): new_path = site_path + run_path # 处理Nginx - filename = self.getHostConf(site_name) - if os.path.exists(filename): - conf = mw.readFile(filename) + site_host = self.getHostConf(site_name) + if os.path.exists(site_host): + conf = mw.readFile(site_host) rep = r'\s*root\s*(.+);' path = re.search(rep, conf).groups()[0] conf = conf.replace(path, new_path) - mw.writeFile(filename, conf) + mw.writeFile(site_host, conf) - self.setSitePath(site_path, run_path) + self.setSitePath(site_id, run_path) mw.restartWeb() return mw.returnData(True, '设置成功!')