fix:添加userID

lu_quan_dev
han 8 months ago
parent 81c97c5086
commit e8fa5cbdfd
  1. 9
      subPageC/Ai/index.vue

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

Loading…
Cancel
Save