wx.request 某些机型返回505
发布于 6 年前 作者 ayi 10127 次浏览 来自 问答

代码端是将某些信息推送到后台服务器,大部分机型执行都没有问题,但是某些机型如vivo,就会返回505,服务器后台接口也没有访问日志


代码段:

wx.request({

url: url,

method:‘POST’,

data: {

“touser”: openID,

“template_id”: “********”,

“form_id”: e.detail.formId,

//小程序某页面链接,由于后台拆这个json,因此要将&转成%26才不会丢失

“page”: ‘pages/showRecord/showRecord?sealName=’ + seal + ‘%26qty=’ + e.detail.value.qty + ‘%26time=’ + this.data.time + ‘%26reason=’ + e.detail.value.reason + ‘%26userName=’ + userName + ‘%26keeperName=’ + keeperName,

“data”: {

“keyword1”: {

“value”: seal,

“color”: “#173177”

},

“keyword2”: {

“value”: e.detail.value.qty,

“color”: “#173177”

},

“keyword3”: {

“value”: this.data.time,

“color”: “#173177”

},

“keyword4”: {

“value”: e.detail.value.reason,

“color”: “#173177”

},

“keyword5”: {

“value”: userName,

“color”: “#173177”

},

“keyword6”: {

“value”: ‘点击查看详细,并进行本次盖章最终确认’,

“color”: “#173177”

}

},

“emphasis_keyword”: “keyword1.DATA”

},

success(res) {

console.log(‘推送模板反馈’, res.data)

//页面直接跳转,无返回键

wx.redirectTo({

url: ‘…/success/success’

})

},

fail(res) {

wx.showModal({

title: ‘异常’,

content: ‘推送审核信息失败,请联系管理员,错误信息:’ + err,

showCancel: false

})

}

})


res内容:

  1. data:""

  2. errMsg:"request:ok"

  3. header:{Connection"keep-alive"Date"Fri, 14 Jun 2019 09:01:12 GMT"Server"nginx/1.4.4"Transfer-Encoding"chunked"X-Android-Received-Millis"1560502871321", …}

  4. statusCode:505

  5. hasOwnProperty:(...)

  6. isPrototypeOf:(...)

  7. propertyIsEnumerable:(...)

  8. toLocaleString:(...)

  9. toString:(...)

  10. valueOf:(...)

  11. __defineGetter__:(...)

  12. __defineSetter__:(...)

  13. __lookupGetter__:(...)

  14. __lookupSetter__:(...)

  15. __proto__:Object

2 回复

前端调用了模板消息的api?

没人解答吗???

回到顶部