refactor: replace uni.showToast calls with shared toast

consolidates repeated toast display logic into a centralized utility, reducing code duplication and standardizing toast behavior across the codebase
This commit is contained in:
duanshuwen
2026-05-29 21:35:10 +08:00
parent 656c592da2
commit 71aa343efb
14 changed files with 36 additions and 106 deletions

View File

@@ -908,10 +908,7 @@ const sendMessage = async (message, isInstruct = false) => {
if (!isWsConnected()) {
// uni.hideLoading();
setTimeout(() => {
// uni.showToast({
// title: "连接服务器失败,请稍后重试",
// icon: "none",
// });
showToast("连接服务器失败,请稍后重试");
}, 100);
return;
}
@@ -920,20 +917,14 @@ const sendMessage = async (message, isInstruct = false) => {
console.error("重新连接WebSocket失败:", error);
// uni.hideLoading();
setTimeout(() => {
// uni.showToast({
// title: "连接服务器失败,请稍后重试",
// icon: "none",
// });
showToast("连接服务器失败,请稍后重试");
}, 100);
return;
}
}
if (isSessionActive.value) {
// uni.showToast({
// title: "请等待当前回复完成",
// icon: "none",
// });
showToast("请等待当前回复完成");
return;
}
isSessionActive.value = true;