开发工具中wx.connectSocket设置header有一定概率失败
不是百分之百复现. 代码片段中执行,复现率比较低,大概0.1 工程中执行,复现率高,大概0.9 [代码]var[代码] [代码]url = [代码][代码]'ws://192.168.31.11/tunnel?uid=5af6e3fbb037f808ec732fe7'[代码][代码]var[代码] [代码]header = { [代码][代码]'X-WX-Id'[代码][代码]: [代码][代码]"5af6e3fbb037f808ec732fe7"[代码][代码], [代码][代码]'X-WX-Skey'[代码][代码]: [代码][代码]"5InbFW95I2HDana02DqDLnLV"[代码] [代码]}[代码][代码]wx.connectSocket({[代码][代码] [代码][代码]url: url,[代码][代码] [代码][代码]header: header,[代码][代码] [代码][代码]complete: (res) => {[代码][代码] [代码][代码]console.log([代码][代码]'complete'[代码][代码], res)[代码][代码] [代码][代码]},[代码][代码]});[代码] 正确情况 [图片] 错误情况 [图片]