|
@@ -16,15 +16,19 @@ App({
|
|
|
initSocket() {
|
|
|
let that = this;
|
|
|
this.globalData.SocketTask = wx.connectSocket({
|
|
|
- url: (this.globalData.http.baseUrl + '/yos/webSocket/').replace("https", "wss").replace("http", "ws") + wx.getStorageSync('userMsg').token,
|
|
|
+ url: this.globalData.http.baseUrl.replace("https", "wss").replace("http", "ws") + '/yos/webSocket/' + wx.getStorageSync('userMsg').token,
|
|
|
complete: (res) => {
|
|
|
console.log(res)
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ console.log(this.globalData.http.baseUrl.replace("https", "wss").replace("http", "ws") + '/yos/webSocket/' + wx.getStorageSync('userMsg').token)
|
|
|
+
|
|
|
this.globalData.SocketTask.onOpen(function (res) {
|
|
|
that.globalData.socketEstablish = true;
|
|
|
})
|
|
|
this.globalData.SocketTask.onMessage(function (res) {
|
|
|
+ console.log("消息", res)
|
|
|
that.globalData.socketCallback(res)
|
|
|
})
|
|
|
this.globalData.SocketTask.onError(function (res) {
|