在红米note4x上请求被拦截,Provisional headers are shown。

在红米note4上 wss请求都没有,绝望。

希望给个解决方案。


代码如下:

testWebSocket() {

let _this = this;

let url = _this.data.wsUri + _this.data.WsToken + "&tid=" + Math.floor(Math.random() * 11);

url = encodeURI(url).replace(/\+/g, '%2B'); //将加号转义  成%2B

wx.connectSocket({

url: url,

header: {

'content-type': 'application/json'

},

method: "GET",

success: function(res) {

console.log(res)

_this.SocketOpen();

_this.closeSocket();

},

fail: function(res) {

console.log(res);

_this.testWebSocket();

}

});

},



展开全部
收起
1回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • 一纸荒年

    4人对此回答表示赞同

    其他Android手机还没试过,不知道有没有这个问题

    展开
    4
    1回复
    发布于 6年前

    评论(1)

    收起评论

    • 王大元 2019-01-19 17:50

      {errMsg:"connectSocket:ok",socketTaskId:"1"}

      回复
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部