feat: 订单调起前登录检验
This commit is contained in:
@@ -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消息
|
||||
|
||||
Reference in New Issue
Block a user