feat: fix bug in signup and reset phone and email (#1396)

* fix: fix bug in signup and reset phone and email

* delete useless addition
This commit is contained in:
Mr Forest
2022-12-11 15:52:36 +08:00
committed by GitHub
parent ef836acfe9
commit eca2527bc0
7 changed files with 14 additions and 6 deletions

View File

@ -22,7 +22,7 @@ import {CaptchaWidget} from "./CaptchaWidget";
const {Search} = Input;
export const CountDownInput = (props) => {
const {disabled, textBefore, onChange, onButtonClickArgs, application} = props;
const {disabled, textBefore, onChange, onButtonClickArgs, application, method} = props;
const [visible, setVisible] = React.useState(false);
const [key, setKey] = React.useState("");
const [captchaImg, setCaptchaImg] = React.useState("");
@ -53,7 +53,7 @@ export const CountDownInput = (props) => {
const handleOk = () => {
setVisible(false);
setButtonLoading(true);
UserBackend.sendCode(checkType, checkId, key, ...onButtonClickArgs).then(res => {
UserBackend.sendCode(checkType, checkId, key, method, ...onButtonClickArgs).then(res => {
setKey("");
setButtonLoading(false);
if (res) {
@ -70,7 +70,7 @@ export const CountDownInput = (props) => {
const loadCaptcha = () => {
UserBackend.getCaptcha(application.owner, application.name, false).then(res => {
if (res.type === "none") {
UserBackend.sendCode("none", "", "", ...onButtonClickArgs).then(res => {
UserBackend.sendCode("none", "", "", method, ...onButtonClickArgs).then(res => {
if (res) {
handleCountDown(60);
}