This commit is contained in:
2026-02-24 19:00:40 +08:00
parent b6bf036f8f
commit a48770eaa6

View File

@@ -1,4 +1,4 @@
import { showToast } from "vant";
import { showToast, showLoadingToast, closeToast } from "vant";
import useApiFetch from "@/composables/useApiFetch";
// 阿里云验证码场景 ID
@@ -117,6 +117,14 @@ export function useAliyunCaptcha() {
return;
}
const loading = showLoadingToast({
message: "安全验证加载中...",
forbidClick: true,
duration: 0,
loadingType: "spinner",
});
try {
window.__captchaVerifyCallback = async (captchaVerifyParam) => {
window.__lastBizResponse = null;
const { data, error } = await bizVerify(captchaVerifyParam);
@@ -153,6 +161,9 @@ export function useAliyunCaptcha() {
}
window.__onCaptchaBizSuccess = onSuccess;
window.captcha.show();
} finally {
closeToast();
}
}
return { runWithCaptcha };