mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
fix: reset phone email data error and removed dom API from it
Signed-off-by: Kininaru <shiftregister233@outlook.com>
This commit is contained in:
@ -23,6 +23,8 @@ export const ResetModal = (props) => {
|
|||||||
const [confirmLoading, setConfirmLoading] = React.useState(false);
|
const [confirmLoading, setConfirmLoading] = React.useState(false);
|
||||||
const [sendButtonText, setSendButtonText] = React.useState(i18next.t("user:Send Code"));
|
const [sendButtonText, setSendButtonText] = React.useState(i18next.t("user:Send Code"));
|
||||||
const [sendCodeCoolDown, setCoolDown] = React.useState(false);
|
const [sendCodeCoolDown, setCoolDown] = React.useState(false);
|
||||||
|
const [dest, setDest] = React.useState("");
|
||||||
|
const [code, setCode] = React.useState("");
|
||||||
const {buttonText, destType, coolDownTime} = props;
|
const {buttonText, destType, coolDownTime} = props;
|
||||||
|
|
||||||
const showModal = () => {
|
const showModal = () => {
|
||||||
@ -34,8 +36,6 @@ export const ResetModal = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
let dest = document.getElementById("dest").value;
|
|
||||||
let code = document.getElementById("code").value;
|
|
||||||
if (dest === "") {
|
if (dest === "") {
|
||||||
Setting.showMessage("error", i18next.t("user:Empty " + destType));
|
Setting.showMessage("error", i18next.t("user:Empty " + destType));
|
||||||
return;
|
return;
|
||||||
@ -68,7 +68,6 @@ export const ResetModal = (props) => {
|
|||||||
|
|
||||||
const sendCode = () => {
|
const sendCode = () => {
|
||||||
if (sendCodeCoolDown) return;
|
if (sendCodeCoolDown) return;
|
||||||
let dest = document.getElementById("dest").value;
|
|
||||||
if (dest === "") {
|
if (dest === "") {
|
||||||
Setting.showMessage("error", i18next.t("user:Empty " + destType));
|
Setting.showMessage("error", i18next.t("user:Empty " + destType));
|
||||||
return;
|
return;
|
||||||
@ -105,13 +104,13 @@ export const ResetModal = (props) => {
|
|||||||
>
|
>
|
||||||
<Col style={{margin: "0px auto 40px auto", width: 1000, height: 300}}>
|
<Col style={{margin: "0px auto 40px auto", width: 1000, height: 300}}>
|
||||||
<Row style={{width: "100%", marginBottom: "20px"}}>
|
<Row style={{width: "100%", marginBottom: "20px"}}>
|
||||||
<Input addonBefore={i18next.t("user:New " + destType)} id="dest" placeholder={placeHolder}
|
<Input addonBefore={i18next.t("user:New " + destType)} placeholder={placeHolder} onChange={(e) => setDest(e.target.value)}
|
||||||
addonAfter={<button style={{width: "90px", border: "none", backgroundColor: "#fff"}} onClick={sendCode}>{" " + sendButtonText + " "}</button>}
|
addonAfter={<button style={{width: "90px", border: "none", backgroundColor: "#fff"}} onClick={sendCode}>{" " + sendButtonText + " "}</button>}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</Row>
|
</Row>
|
||||||
<Row style={{width: "100%", marginBottom: "20px"}}>
|
<Row style={{width: "100%", marginBottom: "20px"}}>
|
||||||
<Input addonBefore={i18next.t("user:Code You Received")} placeholder={i18next.t("user:Enter your code")} id="code"/>
|
<Input addonBefore={i18next.t("user:Code You Received")} placeholder={i18next.t("user:Enter your code")} onChange={(e) => setCode(e.target.value)}/>
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
Reference in New Issue
Block a user