fix 发送验证码 1分钟内不允许再次点击

This commit is contained in:
wkj 2024-04-15 17:37:17 +08:00
parent ecdb627c21
commit 1fbc287e40
3 changed files with 3 additions and 3 deletions

View File

@ -1113,7 +1113,7 @@ export async function sendCaptcha({ mobile, env, type: type2, }, context) {
closeRootMode();
return `验证码[${code}]已创建`;
}
else if (captcha.$$createAt$$ - now < 60000) {
else if (now - captcha.$$createAt$$ < 60000) {
closeRootMode();
throw new OakUserException('您的操作太迅捷啦,请稍等再点吧');
}

View File

@ -1123,7 +1123,7 @@ async function sendCaptcha({ mobile, env, type: type2, }, context) {
closeRootMode();
return `验证码[${code}]已创建`;
}
else if (captcha.$$createAt$$ - now < 60000) {
else if (now - captcha.$$createAt$$ < 60000) {
closeRootMode();
throw new types_1.OakUserException('您的操作太迅捷啦,请稍等再点吧');
}

View File

@ -1604,7 +1604,7 @@ export async function sendCaptcha<
if (process.env.NODE_ENV === 'development' || mockSend) {
closeRootMode();
return `验证码[${code}]已创建`;
} else if ((captcha.$$createAt$$! as number) - now < 60000) {
} else if (now - (captcha.$$createAt$$! as number) < 60000) {
closeRootMode();
throw new OakUserException('您的操作太迅捷啦,请稍等再点吧');
} else {