Commit c51770da4196da0a83813cc0d105644db6ef2305

Authored by vking
1 parent ec06dc60

rebot

Showing 1 changed file with 10 additions and 3 deletions
@@ -3,17 +3,24 @@ import util from './util' @@ -3,17 +3,24 @@ import util from './util'
3 export default { 3 export default {
4 async msg (json){ 4 async msg (json){
5 let pages = getCurrentPages(); 5 let pages = getCurrentPages();
6 - let p = pages[pages.length - 1];  
7 - console.log('p',p.route,p.options) 6 + //let p = pages[pages.length - 1];
  7 + let px='',pl=pages.length,str=''
  8 + for(let pi=pl-1,pj=0;pi>=0;pi--){
  9 + px+=">"+str+util.http_build_query(pages[pi].options,pages[pi].route)+"\n"
  10 + str+='→';
  11 + pj++
  12 + if(pj>2) break;
  13 + }
8 wx.request({ 14 wx.request({
9 url: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9094c8cc-ec7f-4221-b1d9-50e71e008aa9', 15 url: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9094c8cc-ec7f-4221-b1d9-50e71e008aa9',
  16 + //url: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=6093c5ae-d02a-4708-99a2-e80b82280fd0',//测试用
10 method: 'POST', 17 method: 'POST',
11 data: { 18 data: {
12 msgtype:'markdown', 19 msgtype:'markdown',
13 markdown:{ 20 markdown:{
14 content: 21 content:
15 "**"+util.unixtoTime(new Date()/1000,'YYYY-MM-DD HH:II:SS')+"**\n"+ 22 "**"+util.unixtoTime(new Date()/1000,'YYYY-MM-DD HH:II:SS')+"**\n"+
16 - ">"+util.http_build_query(p.options,p.route)+"\n"+ 23 + px+
17 "><font color=\"red\">"+await getApp().getOpenid()+"</font>\n"+ 24 "><font color=\"red\">"+await getApp().getOpenid()+"</font>\n"+
18 ">"+json.url+"\n\n"+ 25 ">"+json.url+"\n\n"+
19 (typeof json.res == 'string'?json.res:JSON.stringify(json.res)).substr(0,500)+"\n\n" 26 (typeof json.res == 'string'?json.res:JSON.stringify(json.res)).substr(0,500)+"\n\n"