Skip to content

Commit

Permalink
Update site.py
Browse files Browse the repository at this point in the history
  • Loading branch information
midoks committed Dec 25, 2024
1 parent aa4951b commit 9fa04c9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/utils/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,15 +978,15 @@ def setSiteRunPath(self, site_id, run_path):
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, '设置成功!')

Expand Down

0 comments on commit 9fa04c9

Please sign in to comment.