From 4b5d985363e8e1f9bbc2705deab511bf4be15553 Mon Sep 17 00:00:00 2001 From: nelson Date: Mon, 8 Jan 2024 10:52:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0PushPlus=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=8F=92=E4=BB=B6=E7=9A=84=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/pushplusmsg/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/pushplusmsg/__init__.py b/plugins/pushplusmsg/__init__.py index 65d4b08..062f0d4 100644 --- a/plugins/pushplusmsg/__init__.py +++ b/plugins/pushplusmsg/__init__.py @@ -174,21 +174,23 @@ class PushPlusMsg(_PluginBase): try: sc_url = "http://www.pushplus.plus/send?token=%s&title=%s&content=%s&template=json" % (self._token, urlencode(title), urlencode(text)) + logger.info(f"PushPlus消息准备发送,信息内容:{sc_url}") res = RequestUtils().get_res(sc_url) if res and res.status_code == 200: + logger.info(f"PushPlus消息发送成功,返回信息:{res}") ret_json = res.json() - errno = ret_json.get('errcode') - error = ret_json.get('errmsg') - if errno == 0: + code = ret_json.get('code') + msg = ret_json.get('msg') + if code == 200: logger.info("PushPlus消息发送成功") else: - logger.warn(f"PushPlus消息发送失败,错误码:{errno},错误原因:{error}") + logger.warn(f"PushPlus消息发送,接口返回失败,错误码:{code},错误原因:{msg}") elif res is not None: logger.warn(f"PushPlus消息发送失败,错误码:{res.status_code},错误原因:{res.reason}") else: logger.warn("PushPlus消息发送失败,未获取到返回信息") except Exception as msg_e: - logger.error(f"PushPlus消息发送失败,{str(msg_e)}") + logger.error(f"PushPlus消息发送异常,{str(msg_e)}") def stop_service(self): """