Commit fa510e23074f6026e96035c00e8c88eddf6fdfbc

Authored by liuxuqinfhp1220
2 parents 1c7e3b77 e9ede7e8

Merge branch 'master' of http://123.56.79.57/xt/xcx-book

# By vking
# Via vking
* 'master' of http://123.56.79.57/xt/xcx-book:
  rebot
Showing 2 changed files with 22 additions and 0 deletions
... ... @@ -8,6 +8,7 @@ const api_timeout = 2000; //接口超时时间,默认2s
//引入接口映射关系表
import api from './api.url'
import uri_dc from './uri'
import bot from './rebot'
const server_host = uri_dc.HOST__LINE;
... ... @@ -157,6 +158,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr
res.data.msg = res.data.msg.replace('非法请求:', '');
} catch (e) {
console.log('res-fail', res, e);
bot.msg('接口错误', {url: host + cache_key, res: res.data})
if (wx.getRealtimeLogManager) {
const logger = wx.getRealtimeLogManager()
logger.error('接口错误', {url: host + cache_key, res: res.data})
... ... @@ -164,6 +166,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr
}
}
} else {
bot.msg('接口错误', {url: host + cache_key, res: res})
if (wx.getRealtimeLogManager) {
const logger = wx.getRealtimeLogManager()
logger.error('接口错误', {url: host + cache_key, res: res})
... ... @@ -182,6 +185,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr
// });
//query.show();
//console.log('net',query);
bot.msg('接口错误', {url: host + cache_key, res: res})
if (wx.getRealtimeLogManager) {
const logger = wx.getRealtimeLogManager()
logger.error('调用失败', {url: host + cache_key, res: res})
... ...
//https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9094c8cc-ec7f-4221-b1d9-50e71e008aa9
export default {
msg(message){
wx.request({
url: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9094c8cc-ec7f-4221-b1d9-50e71e008aa9',
method: 'POST',
data: {
msgtype:'text',
text:{
content:message,
},
},
header: {
'Content-Type': 'application/json'
},
})
},
}
\ No newline at end of file
... ...