feat: 订单调起前登录检验

This commit is contained in:
2025-09-16 20:54:20 +08:00
parent 6443b67d15
commit 69fe1b80c8

View File

@@ -287,6 +287,11 @@ const handleReply = (text) => {
// 是发送指令
const handleReplyInstruct = (item) => {
if (!appStore.hasToken) {
console.log("没有token跳转到登录页");
goLogin();
return;
}
if (item.type === "MyOrder") {
// 订单
uni.navigateTo({
@@ -480,11 +485,14 @@ const initWebSocket = () => {
});
// 初始化连接
webSocketManager.connect().then(() => {
webSocketConnectStatus = true;
}).catch((error) => {
console.error("WebSocket连接失败:", error);
});
webSocketManager
.connect()
.then(() => {
webSocketConnectStatus = true;
})
.catch((error) => {
console.error("WebSocket连接失败:", error);
});
};
// 处理WebSocket消息