feat: 给toast 添加延迟

This commit is contained in:
2026-04-07 21:03:33 +08:00
parent 13d81f602a
commit 677333cc5f
3 changed files with 33 additions and 14 deletions

View File

@@ -848,20 +848,24 @@ const sendMessage = async (message, isInstruct = false) => {
// 检查连接是否成功建立
if (!isWsConnected()) {
uni.hideLoading();
uni.showToast({
title: "连接服务器失败,请稍后重试",
icon: "none",
});
setTimeout(() => {
uni.showToast({
title: "连接服务器失败,请稍后重试",
icon: "none",
});
}, 100);
return;
}
uni.hideLoading();
} catch (error) {
console.error("重新连接WebSocket失败:", error);
uni.hideLoading();
uni.showToast({
title: "连接服务器失败,请稍后重试",
icon: "none",
});
setTimeout(() => {
uni.showToast({
title: "连接服务器失败,请稍后重试",
icon: "none",
});
}, 100);
return;
}
}