websocket逻辑优化
This commit is contained in:
@@ -13,6 +13,7 @@ export const checkConnection = () => {
|
||||
uni.sendSocketMessage({
|
||||
data: JSON.stringify({ event: "ping", data: {} }),
|
||||
fail: () => {
|
||||
websocket.closeWebSocket();
|
||||
const token = uni.getStorageSync("token");
|
||||
if (!token) return;
|
||||
// 如果发送失败,说明连接已断开,需要重新连接
|
||||
|
||||
Reference in New Issue
Block a user