From eaf341cda60a52a11b8ca260022639a27fdd46a9 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 7 Jan 2023 00:37:20 +0800 Subject: [PATCH] Update index.py --- plugins/webstats/index.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/webstats/index.py b/plugins/webstats/index.py index 9ec2279ea..fc5a8f874 100755 --- a/plugins/webstats/index.py +++ b/plugins/webstats/index.py @@ -222,6 +222,15 @@ def initDreplace(): content = content.replace('{$ROOT_PATH}', mw.getServerDir()) mw.writeFile(path, content) + # 已经安装的 + al_config = getServerDir() + "/lua/config.json" + if os.path.exists(al_config): + tmp = json.loads(mw.readFile(al_config)) + if tmp['global']['record_post_args'] or tmp['global']['record_get_403_args']: + openLuaNeedRequestBody() + else: + closeLuaNeedRequestBody() + lua_dir = getServerDir() + "/lua" if not os.path.exists(lua_dir): mw.execShell('mkdir -p ' + lua_dir)