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) => { const handleReplyInstruct = (item) => {
if (!appStore.hasToken) {
console.log("没有token跳转到登录页");
goLogin();
return;
}
if (item.type === "MyOrder") { if (item.type === "MyOrder") {
// 订单 // 订单
uni.navigateTo({ uni.navigateTo({
@@ -480,9 +485,12 @@ const initWebSocket = () => {
}); });
// 初始化连接 // 初始化连接
webSocketManager.connect().then(() => { webSocketManager
.connect()
.then(() => {
webSocketConnectStatus = true; webSocketConnectStatus = true;
}).catch((error) => { })
.catch((error) => {
console.error("WebSocket连接失败:", error); console.error("WebSocket连接失败:", error);
}); });
}; };