优化问题

This commit is contained in:
duan
2024-05-30 09:12:02 +08:00
parent 66e15baaee
commit cb7d853707
8 changed files with 296 additions and 146 deletions

View File

@@ -310,6 +310,8 @@
})
try {
if (res.data) {
let time = new Date
console.log(time,'时间戳')
uni.cache.set('shopUser', res.data)
this.handlemessage()
}
@@ -398,11 +400,12 @@
}
},
handlemessage() {
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
console.log(this.socketTicket,'是否存在socketTicket1')
// this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
this.socketTicket = new webSocketUtils(
`${uni.conf.baseUrlwws}/websocket/table/${uni.cache.get('tableCode')}/${uni.cache.get('shopUser')}/${uni.cache.get('userInfo').id}`,
5000)
console.log(this.socketTicket,'是否存在socketTicket3')
},
// 数据处理
socketSendMsg(data) {