微信7.0.1 wx.request GET方法请求服务器丢失数据
- 当前 Bug 的表现(可附上截图)
ios 微信7.0.1 使用wx.request get方法时,提交数据不全。
wx.request({ url: app.globalData.config.api_url + '/api/cards/' + card_id , // 仅为示例,并非真实的接口地址 method: 'GET' , header: { 'content-type' : 'application/json' , // 默认值 'authorization' : 'JWT ' + access_token }, success(res) { console.log(res.data) console.log(res) if (res.statusCode===200){ wx.showToast({ title: '数据获取成功' , icon: 'success' , duration: 2000 }) resolve(res) } }, fail(){ wx.showToast({ title: '请求失败,请重试' , icon: 'fail' , duration: 2000 }) reject( false ) } }); |
代码中的’authorization’
:
字段没能提交到服务器。
最新模拟器和安卓微信6.7.3正常。
附上不同客户端调试的时候,抓包的数据。
安卓6.7.3:
数据包: GET /api/cards/3/ HTTP/1.1 charset: utf-8 Accept-Encoding: gzip referer: https: //servicewechat.com/wx36013b2c5a309bed/0/page-frame.html authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNTQ2MDEzNTY4LCJqdGkiOiJmNGVlOTk2ZmM2MDI0NTE1OTczNzhjYTliYTQwZDFlYSIsInVzZXJfaWQiOjV9.tkGxTDjpbnLDa3DDQyCVKJ2-92pxYm9CIwtvklRn6jI content-type: application/json User-Agent: Mozilla/5.0 (Linux; Android 6.0; HUAWEI MT7-CL00 Build/HuaweiMT7-CL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/49.0.2623.105 Mobile Safari/537.36 MicroMessenger/6.7.3.1360(0x2607033D) NetType/WIFI Language/zh_CN Process/appbrand2 Host: 192.168.88.88:8000 Connection: Keep-Alive |
ios 7.0.1
数据包: GET /api/cards/4/ HTTP/1.1 Host: 192.168.88.88:8000 Content-Type: application/json Accept-Encoding: gzip, deflate Connection: keep-alive Accept: */* User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16C101 MicroMessenger/7.0.1(0x17000120) NetType/WIFI Language/zh_CN Referer: https: //servicewechat.com/wx36013b2c5a309bed/0/page-frame.html Accept-Language: zh-cn |
- 预期表现
- 复现路径
- 提供一个最简复现 Demo
2 回复