From 4bd5cdb89ea194c0d85e5e1672d0e2fd4a538817 Mon Sep 17 00:00:00 2001 From: "littlefatty.wong" Date: Tue, 15 Jan 2019 11:57:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99PushBear=E6=B7=BB=E5=8A=A0SC=5FKEY?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=94=A8=E4=BA=8E=E5=A1=AB=E5=86=99send=5Fke?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env.docker.py.example | 3 ++- env.py.example | 3 ++- py12306/app.py | 2 +- py12306/config.py | 3 ++- py12306/order/order.py | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/env.docker.py.example b/env.docker.py.example index ff8b415..54d626f 100644 --- a/env.docker.py.example +++ b/env.docker.py.example @@ -54,8 +54,9 @@ TELEGRAM_BOT_API_URL = 'https://tgbot.lbyczf.com/sendMessage/:your_token' # ServerChan和PushBear配置 SERVERCHAN_ENABLED = 0 -PUSHBEAR_ENABLED = 0 S_KEY = 'SCUdafadsfasfdafdf45234234234' +PUSHBEAR_ENABLED = 0 +SC_KEY = '8474-ca071ADSFADSF' # 输出日志到文件 (Docker 中不建议修改此组配置项) OUT_PUT_LOG_TO_FILE_ENABLED = 1 diff --git a/env.py.example b/env.py.example index 8b3c77f..1f43247 100644 --- a/env.py.example +++ b/env.py.example @@ -54,8 +54,9 @@ TELEGRAM_BOT_API_URL = 'https://tgbot.lbyczf.com/sendMessage/:your_token' # ServerChan和PushBear配置 SERVERCHAN_ENABLED = 0 -PUSHBEAR_ENABLED = 0 S_KEY = 'SCUdafadsfasfdafdf45234234234' +PUSHBEAR_ENABLED = 0 +SC_KEY = '8474-ca071ADSFADSF' # 输出日志到文件 OUT_PUT_LOG_TO_FILE_ENABLED = 0 diff --git a/py12306/app.py b/py12306/app.py index b235359..2c62d5b 100644 --- a/py12306/app.py +++ b/py12306/app.py @@ -123,7 +123,7 @@ class App: if Config().PUSHBEAR_ENABLED: # PushBear通知 CommonLog.add_quick_log(CommonLog.MESSAGE_TEST_SEND_PUSH_BEAR).flush() - Notification.push_bear(Config().S_KEY, '测试发送消息', 'By py12306') + Notification.push_bear(Config().SC_KEY, '测试发送消息', 'By py12306') @classmethod def run_check(cls): diff --git a/py12306/config.py b/py12306/config.py index ac7a1f7..ca43739 100644 --- a/py12306/config.py +++ b/py12306/config.py @@ -64,8 +64,9 @@ class Config: # ServerChan和PushBear配置 SERVERCHAN_ENABLED = 0 - PUSHBEAR_ENABLED = 0 S_KEY = '' + PUSHBEAR_ENABLED = 0 + SC_KEY = '' # 邮箱配置 EMAIL_ENABLED = 0 diff --git a/py12306/order/order.py b/py12306/order/order.py index 8c837e2..797d94d 100644 --- a/py12306/order/order.py +++ b/py12306/order/order.py @@ -91,7 +91,7 @@ class Order: Notification.server_chan(Config().S_KEY, OrderLog.MESSAGE_ORDER_SUCCESS_NOTIFICATION_TITLE, OrderLog.MESSAGE_ORDER_SUCCESS_NOTIFICATION_OF_EMAIL_CONTENT.format(self.order_id)) if Config().PUSHBEAR_ENABLED: # PushBear通知 - Notification.push_bear(Config().S_KEY, OrderLog.MESSAGE_ORDER_SUCCESS_NOTIFICATION_TITLE, + Notification.push_bear(Config().SC_KEY, OrderLog.MESSAGE_ORDER_SUCCESS_NOTIFICATION_TITLE, OrderLog.MESSAGE_ORDER_SUCCESS_NOTIFICATION_OF_EMAIL_CONTENT.format(self.order_id)) while sustain_time: # TODO 后面直接查询有没有待支付的订单就可以 num += 1