From a8b1fbbef00003696b784034a0537672dc4d40a6 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 21 Oct 2023 14:04:37 +0800 Subject: [PATCH] fix #884 --- app/main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 9a6e4412..5973cb6b 100644 --- a/app/main.py +++ b/app/main.py @@ -62,17 +62,24 @@ def start_frontend(): """ if not SystemUtils.is_frozen(): return + # 临时Nginx目录 nginx_path = settings.ROOT_PATH / 'nginx' if not nginx_path.exists(): return + # 配置目录下的Nginx目录 + run_nginx_dir = settings.CONFIG_PATH.with_name('nginx') + if not run_nginx_dir.exists(): + # 移动到配置目录 + SystemUtils.move(nginx_path, run_nginx_dir) + # 启动Nginx import subprocess if SystemUtils.is_windows(): subprocess.Popen("start nginx.exe", - cwd=nginx_path, + cwd=run_nginx_dir, shell=True) else: subprocess.Popen("nohup ./nginx &", - cwd=nginx_path, + cwd=run_nginx_dir, shell=True)