Refactor API requests and update imports
This commit is contained in:
@ -55,16 +55,18 @@ export default defineStore("useUserStore", {
|
||||
},
|
||||
// 建立连接mqtt
|
||||
async connectMqtt() {
|
||||
this.mqttClient = new MQTTClient("wss://www.tuxixi.net/mqtt", {
|
||||
clientId: this.userInfoRes.id,
|
||||
});
|
||||
await this.mqttClient.connect();
|
||||
await this.mqttClient?.subscribe(
|
||||
`zbjk_message_single/${this.userInfoRes.id}`
|
||||
);
|
||||
await this.mqttClient?.subscribe(
|
||||
`zbjk_message_kefu/${this.userInfoRes.id}`
|
||||
);
|
||||
if (process.client) {
|
||||
// this.mqttClient = new MQTTClient("wss://www.tuxixi.net/mqtt", {
|
||||
// clientId: this.userInfoRes.id,
|
||||
// });
|
||||
// await this.mqttClient.connect();
|
||||
// await this.mqttClient?.subscribe(
|
||||
// `zbjk_message_single/${this.userInfoRes.id}`
|
||||
// );
|
||||
// await this.mqttClient?.subscribe(
|
||||
// `zbjk_message_kefu/${this.userInfoRes.id}`
|
||||
// );
|
||||
}
|
||||
},
|
||||
async getToken(row: any) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user