From 395bf3aa5a61a35da5b6368b799ab341794c3d3b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 28 Sep 2024 21:41:29 +0800 Subject: [PATCH] Update __init__.py --- route/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/route/__init__.py b/route/__init__.py index 7991de521..9296aecbb 100755 --- a/route/__init__.py +++ b/route/__init__.py @@ -269,9 +269,12 @@ def webhook(): if not os.path.exists(wh_install_path): return mw.returnJson(False, '请先安装WebHook插件!') - sys.path.append('plugins/webhook') - import index - return index.runShellArgs(input_args) + try: + sys.path.append(os.getcwd() + "/plugins/webhook") + import index + return index.runShellArgs(input_args) + except Exception as e: + return 'error' @app.route('/close')