diff --git a/pages/chat/ChatMainList.vue b/pages/chat/ChatMainList.vue index 334d918..5818c94 100644 --- a/pages/chat/ChatMainList.vue +++ b/pages/chat/ChatMainList.vue @@ -609,6 +609,12 @@ const initData = () => { const sendMessage = (message, isInstruct = false) => { console.log("发送的消息:", message); + if (!appStore.hasToken) { + console.log("没有token,跳转到登录页"); + goLogin(); + return; + } + if (!webSocketConnectStatus) { uni.showToast({ title: "当前网络异常,请稍后重试", @@ -617,12 +623,6 @@ const sendMessage = (message, isInstruct = false) => { return; } - if (!appStore.hasToken) { - console.log("没有token,跳转到登录页"); - goLogin(); - return; - } - if (isSessionActive.value) { uni.showToast({ title: "请等待当前回复完成",