pinia引入

This commit is contained in:
yanghang
2025-06-30 14:54:39 +08:00
parent 7833c0f1a5
commit e1da68c59b
10 changed files with 697 additions and 114 deletions
-1
View File
@@ -42,7 +42,6 @@ export const goto_login_fun = () => {
})
}
export default function request({
url,
method,
+5 -1
View File
@@ -52,7 +52,7 @@ export default class WebSocketUtil {
console.log('WebSocket连接已打开');
this.reconnectCount = 0; // 重置重连计数
clearInterval(this.reconnectTimer); // 清除重连计时器
this.startHeartbeat(); // 启动心跳机制
// this.startHeartbeat(); // 启动心跳机制
this.triggerEvent('open'); // 触发连接打开事件
});
@@ -113,6 +113,10 @@ export default class WebSocketUtil {
triggerEvent(event, data) {
if (this.callbacks[event]) {
this.callbacks[event].forEach(callback => callback(data));
uni.$emit('socketEvent',{
type: event,
data
})
}
}