From 3c42a4e450a735dc4e010c91bc0649c8f7b31dc8 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 8 Mar 2023 17:56:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E9=80=9A=E7=9F=A5=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=8A=A0=E5=AF=86=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/core/mw.py | 14 ++++++++++---- route/static/app/config.js | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/class/core/mw.py b/class/core/mw.py index 3ba6fc80b..abeeeed1a 100755 --- a/class/core/mw.py +++ b/class/core/mw.py @@ -1679,9 +1679,15 @@ def getNotifyPath(): def getNotifyData(): initNotifyConfig() - p = getNotifyPath() - t = readFile(p) - return json.loads(t) + notify_file = getNotifyPath() + notify_data = readFile(notify_file) + + data = json.loads(notify_data) + tag_list = ['tgbot'] + for t in tag_list: + if t in data: + data[t]['data'] = json.loads(deDoubleCrypt(t, data[t]['cfg'])) + return data def writeNotify(data): @@ -1730,7 +1736,7 @@ def notifyMessage(msg): do_notify = False if 'tgbot' in data and 'enable' in data['tgbot']: if data['tgbot']['enable']: - t = data['tgbot'] + t = data['tgbot']['data'] do_notify = tgbotNotifyMessage(t['app_token'], t['chat_id'], msg) return do_notify diff --git a/route/static/app/config.js b/route/static/app/config.js index b4b9c899c..949234cf0 100755 --- a/route/static/app/config.js +++ b/route/static/app/config.js @@ -374,8 +374,8 @@ function getTgbot(){ if (data.status){ if (typeof(data['data']['tgbot']) !='undefined'){ - app_token = data['data']['tgbot']['app_token']; - chat_id = data['data']['tgbot']['chat_id']; + app_token = data['data']['tgbot']['data']['app_token']; + chat_id = data['data']['tgbot']['data']['chat_id']; } }