From abfc790d55fc28f37cd273aaab12865208239519 Mon Sep 17 00:00:00 2001 From: night-raise <90231086+night-raise@users.noreply.github.com> Date: Tue, 7 Sep 2021 11:53:17 +0800 Subject: [PATCH] Update notify.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复企业微信获取变量bug --- sample/notify.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sample/notify.py b/sample/notify.py index f61ac804..aaad6fd5 100644 --- a/sample/notify.py +++ b/sample/notify.py @@ -214,11 +214,12 @@ def pushplus_bot(title, content): def qywxapp_bot(title, content): print("\n") - if not QYWX_APP: + if not push_config.get('QYWX_APP'): print("企业微信应用的QYWX_APP未设置!!\n取消推送") return - print("企业微信应用启动") - qywx_app_params = QYWX_APP.split(',') + print("企业微信 应用启动") + + qywx_app_params = push_config.get('QYWX_APP').split(',') url='https://qyapi.weixin.qq.com/cgi-bin/gettoken' headers= { 'Content-Type': 'application/json', @@ -290,7 +291,7 @@ def qywxapp_bot(title, content): print('推送失败!') def change_user_id(desp): - qywx_app_params = QYWX_APP.split(',') + qywx_app_params = push_config.get('QYWX_APP').split(',') if qywx_app_params[2]: userIdTmp = qywx_app_params[2].split("|") userId = ""