Commit 968f58e5 authored by wykolor's avatar wykolor

feat: 优化获取验证码

parent 4c213d5f
......@@ -210,16 +210,24 @@ const Withdraw = defineComponent({
async (res: TencentCaptchaResponse) => {
const { ret, randstr, ticket } = res;
if (ret === 0) {
state.smsVerifyPass = true;
state.tencentCaptchPass = true;
countDown(60, 1000, (time: number) => {
time === 0 ? (state.showTime = `获取验证码`) : (state.showTime = `${time} 后再获取`);
if (time === 0) {
state.smsVerifyPass = false;
}
});
const { data } = await checkCaptcha({ randStr: randstr, ticket });
state.mobileTip = data;
state.smsVerifyPass = true;
try {
const { data } = await checkCaptcha({ randStr: randstr, ticket });
Toast("发送验证码成功");
state.mobileTip = data;
countDown(60, 1000, (time: number) => {
time === 0
? (state.showTime = `获取验证码`)
: (state.showTime = `${time} 后再获取`);
if (time === 0) {
state.smsVerifyPass = false;
}
});
} catch {
Toast("发送验证码失败,请重试");
state.smsVerifyPass = false;
}
}
},
{
......@@ -441,7 +449,7 @@ export default Withdraw;
.van-button {
width: 220px;
height: 80px;
background: #027AFF;
background: #027aff;
border-radius: 0px 8px 8px 0px;
font-size: 26px;
box-sizing: border-box;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment