mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:59:25 +08:00
对通知配置进行加密处理
This commit is contained in:
+10
-4
@@ -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
|
||||
|
||||
|
||||
@@ -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'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user