fix: don't trigger countdown if failed to send verification code (#815)

* feat: add countdown when no captcha provider found

* fix: add countdown when sent code successfully
This commit is contained in:
Resulte Lee
2022-06-22 22:22:40 +08:00
committed by GitHub
parent c8c4dfbfb8
commit f99c1f44e8

View File

@ -69,7 +69,11 @@ export const CountDownInput = (props) => {
const loadCaptcha = () => {
UserBackend.getCaptcha("admin", authConfig.appName, false).then(res => {
if (res.type === "none") {
UserBackend.sendCode("none", "", "", ...onButtonClickArgs);
UserBackend.sendCode("none", "", "", ...onButtonClickArgs).then(res => {
if (res) {
handleCountDown(60);
}
});
} else if (res.type === "Default") {
setCheckId(res.captchaId);
setCaptchaImg(res.captchaImage);