Showing
2 changed files
with
22 additions
and
0 deletions
| @@ -8,6 +8,7 @@ const api_timeout = 2000; //接口超时时间,默认2s | @@ -8,6 +8,7 @@ const api_timeout = 2000; //接口超时时间,默认2s | ||
| 8 | //引入接口映射关系表 | 8 | //引入接口映射关系表 |
| 9 | import api from './api.url' | 9 | import api from './api.url' |
| 10 | import uri_dc from './uri' | 10 | import uri_dc from './uri' |
| 11 | +import bot from './rebot' | ||
| 11 | 12 | ||
| 12 | const server_host = uri_dc.HOST__LINE; | 13 | const server_host = uri_dc.HOST__LINE; |
| 13 | 14 | ||
| @@ -157,6 +158,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr | @@ -157,6 +158,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr | ||
| 157 | res.data.msg = res.data.msg.replace('非法请求:', ''); | 158 | res.data.msg = res.data.msg.replace('非法请求:', ''); |
| 158 | } catch (e) { | 159 | } catch (e) { |
| 159 | console.log('res-fail', res, e); | 160 | console.log('res-fail', res, e); |
| 161 | + bot.msg('接口错误', {url: host + cache_key, res: res.data}) | ||
| 160 | if (wx.getRealtimeLogManager) { | 162 | if (wx.getRealtimeLogManager) { |
| 161 | const logger = wx.getRealtimeLogManager() | 163 | const logger = wx.getRealtimeLogManager() |
| 162 | logger.error('接口错误', {url: host + cache_key, res: res.data}) | 164 | logger.error('接口错误', {url: host + cache_key, res: res.data}) |
| @@ -164,6 +166,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr | @@ -164,6 +166,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr | ||
| 164 | } | 166 | } |
| 165 | } | 167 | } |
| 166 | } else { | 168 | } else { |
| 169 | + bot.msg('接口错误', {url: host + cache_key, res: res}) | ||
| 167 | if (wx.getRealtimeLogManager) { | 170 | if (wx.getRealtimeLogManager) { |
| 168 | const logger = wx.getRealtimeLogManager() | 171 | const logger = wx.getRealtimeLogManager() |
| 169 | logger.error('接口错误', {url: host + cache_key, res: res}) | 172 | logger.error('接口错误', {url: host + cache_key, res: res}) |
| @@ -182,6 +185,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr | @@ -182,6 +185,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr | ||
| 182 | // }); | 185 | // }); |
| 183 | //query.show(); | 186 | //query.show(); |
| 184 | //console.log('net',query); | 187 | //console.log('net',query); |
| 188 | + bot.msg('接口错误', {url: host + cache_key, res: res}) | ||
| 185 | if (wx.getRealtimeLogManager) { | 189 | if (wx.getRealtimeLogManager) { |
| 186 | const logger = wx.getRealtimeLogManager() | 190 | const logger = wx.getRealtimeLogManager() |
| 187 | logger.error('调用失败', {url: host + cache_key, res: res}) | 191 | logger.error('调用失败', {url: host + cache_key, res: res}) |
utils/rebot.js
0 → 100644
| 1 | +//https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9094c8cc-ec7f-4221-b1d9-50e71e008aa9 | ||
| 2 | +export default { | ||
| 3 | + msg(message){ | ||
| 4 | + wx.request({ | ||
| 5 | + url: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9094c8cc-ec7f-4221-b1d9-50e71e008aa9', | ||
| 6 | + method: 'POST', | ||
| 7 | + data: { | ||
| 8 | + msgtype:'text', | ||
| 9 | + text:{ | ||
| 10 | + content:message, | ||
| 11 | + }, | ||
| 12 | + }, | ||
| 13 | + header: { | ||
| 14 | + 'Content-Type': 'application/json' | ||
| 15 | + }, | ||
| 16 | + }) | ||
| 17 | + }, | ||
| 18 | +} |
-
Please register or login to post a comment