f
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user