|
|
|
@ -117,6 +117,7 @@ |
|
|
|
|
openid: undefined, |
|
|
|
|
appid: undefined, |
|
|
|
|
}, |
|
|
|
|
nowUserId:null |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onUnload() { |
|
|
|
@ -150,8 +151,8 @@ |
|
|
|
|
userInfo.refreshToken = newRefreshToken; |
|
|
|
|
store.commit('setUserInfo', userInfo) |
|
|
|
|
this.Token = newAccessToken |
|
|
|
|
this.nowUserId = response.data.userId |
|
|
|
|
this.getUserInfo(response.data.userId) |
|
|
|
|
this.connectWs() |
|
|
|
|
}) |
|
|
|
|
.catch(error => { |
|
|
|
|
store.commit('setUserInfo', null) |
|
|
|
@ -183,7 +184,8 @@ |
|
|
|
|
"identity": this.generateRandomString(8), |
|
|
|
|
"userId": userId |
|
|
|
|
}; |
|
|
|
|
console.log(this.querUserInfo) |
|
|
|
|
console.log('querUserInfo',this.querUserInfo) |
|
|
|
|
this.connectWs() |
|
|
|
|
}, |
|
|
|
|
// websocket |
|
|
|
|
connectWs() { |
|
|
|
@ -302,7 +304,8 @@ |
|
|
|
|
// 发送消息 |
|
|
|
|
sendMsg() { |
|
|
|
|
const $this = this |
|
|
|
|
this.getUserInfo() |
|
|
|
|
console.log('$this.nowUserId',$this.nowUserId) |
|
|
|
|
this.getUserInfo($this.nowUserId) |
|
|
|
|
this.list.push({ |
|
|
|
|
content: this.content, |
|
|
|
|
userType: 'friend', |
|
|
|
|