fix: enable captcha in the application which is not built-in (#1061)

This commit is contained in:
Resulte Lee
2022-08-23 23:30:45 +08:00
committed by GitHub
parent e2921419b9
commit f02875e1b1
5 changed files with 8 additions and 3 deletions

View File

@ -17,13 +17,12 @@ import React from "react";
import i18next from "i18next";
import * as UserBackend from "../backend/UserBackend";
import {SafetyOutlined} from "@ant-design/icons";
import {authConfig} from "../auth/Auth";
import {CaptchaWidget} from "./CaptchaWidget";
const {Search} = Input;
export const CountDownInput = (props) => {
const {disabled, textBefore, onChange, onButtonClickArgs} = props;
const {disabled, textBefore, onChange, onButtonClickArgs, application} = props;
const [visible, setVisible] = React.useState(false);
const [key, setKey] = React.useState("");
const [captchaImg, setCaptchaImg] = React.useState("");
@ -69,7 +68,7 @@ export const CountDownInput = (props) => {
};
const loadCaptcha = () => {
UserBackend.getCaptcha("admin", authConfig.appName, false).then(res => {
UserBackend.getCaptcha(application.owner, application.name, false).then(res => {
if (res.type === "none") {
UserBackend.sendCode("none", "", "", ...onButtonClickArgs).then(res => {
if (res) {