feat: 给toast 添加延迟
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user