Commit 0def32cf20f107ea0dcdee98f54936619d32a22c

Authored by vking
1 parent 017b423a

rebot

... ... @@ -149,6 +149,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr
success: function (res) {
console.log('request.api[' + (new Date() - stime) + 'ms]==>', host + cache_key + ('&formids=' + formids.toString()) + '\nrequest.success', res.data);
// return;
//bot.msg({url: host + cache_key, res: res.data})
if (res.data) {
if (cachetime != 0 && res.data.ret == 200) {
cache(cache_key, res.data, cachetime);//.then().catch();
... ...
//https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9094c8cc-ec7f-4221-b1d9-50e71e008aa9
import util from './util'
export default {
msg(message){
msg(json){
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:JSON.stringify(message),
msgtype:'markdown',
markdown:{
content:
"**"+util.unixtoTime(new Date()/1000,'YYYY-MM-DD HH:II:SS')+"**\n"+
">"+json.url+"\n\n"+
(typeof json.res == 'string'?json.res:JSON.stringify(json.res)).substr(0,500)+"\n\n"
},
},
header: {
... ...