feat: 更新提现功能,优化错误处理逻辑,添加成功提示信息,改进界面交互
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user