feat: 更新提现功能,优化错误处理逻辑,添加成功提示信息,改进界面交互

This commit is contained in:
2025-12-17 02:26:05 +07:00
parent 2f1881cc81
commit 2575fa4e00
5 changed files with 37 additions and 9 deletions

View File

@@ -26,9 +26,19 @@ export async function safeClient<T, E>(
const res = await requestPromise();
if (res.error) {
let errMsg = "";
if (!res.error) {
errMsg = "Request failed. Please try again.";
}
else if (typeof res.error === "string") {
errMsg = res.error;
}
else if (res.error && "value" in (res.error as unknown as object)) {
errMsg = String((res.error as unknown as { value: string }).value);
}
if (!options.silent) {
const toast = await toastController.create({
message: typeof error === "string" ? error : "Request failed. Please try again.",
message: errMsg,
duration: 3000,
position: "bottom",
color: "danger",