Sfoglia il codice sorgente

update captcha

CR003
Alex Cheung 1 anno fa
parent
commit
b61dc7d04a
3 ha cambiato i file con 21 aggiunte e 3 eliminazioni
  1. +7
    -1
      src/pages/authentication/auth-forms/BusCustomFormWizard.js
  2. +6
    -1
      src/pages/authentication/auth-forms/CustomFormWizard.js
  3. +8
    -1
      src/pages/authentication/auth-forms/IAmSmartFormWizard.js

+ 7
- 1
src/pages/authentication/auth-forms/BusCustomFormWizard.js Vedi File

@@ -71,6 +71,8 @@ const BusCustomFormWizard = (props) => {
// const [userNameList, setUserNameList] = useState([]);

const [captchaImg, setCaptchaImage] = useState("");
const [base64Url, setBase64Url] = useState("")
const [checkCode, setCheckCode] = useState("")

const handleClickShowPassword = () => {
setShowPassword(!showPassword);
@@ -186,6 +188,7 @@ const BusCustomFormWizard = (props) => {
params: { width: 130, height: 40, captcha: captchaImg},
onSuccess: (responseData) => {
props.setBase64Url(responseData.base64Url)
setBase64Url(responseData.base64Url)
localStorage.setItem("base64Url", responseData.base64Url);
setCaptchaImage(localStorage.getItem('base64Url'));
}
@@ -375,7 +378,9 @@ const BusCustomFormWizard = (props) => {
brExpiryDate: values.brExpiryDate,
contactPerson: values.enName,
tncFlag: tncFlag,
type: "ORG"
type: "ORG",
captcha: base64Url,
checkCode: checkCode
};

var formData = new FormData();
@@ -1429,6 +1434,7 @@ const BusCustomFormWizard = (props) => {
onChange={(event) => {
const value = event.target.value;
props.setCheckCode(event.target.value);
setCheckCode(event.target.value);
formik.setFieldValue("captchaField", value);
}}
sx={{ width: '75%' }}


+ 6
- 1
src/pages/authentication/auth-forms/CustomFormWizard.js Vedi File

@@ -66,7 +66,8 @@ const CustomFormWizard = (props) => {
const [isLoading, setLoding] = useState(true);
const [updateRows, setUpdateRows] = useState([]);
const [captchaImg, setCaptchaImage] = useState("");

const [base64Url, setBase64Url] = useState("")
const [checkCode, setCheckCode] = useState("")

const handleClickShowPassword = () => {
setShowPassword(!showPassword);
@@ -179,6 +180,7 @@ const CustomFormWizard = (props) => {
params: { width: 130, height: 40, captcha: captchaImg },
onSuccess: (responseData) => {
props.setBase64Url(responseData.base64Url)
setBase64Url(responseData.base64Url)
localStorage.setItem("base64Url", responseData.base64Url);
setCaptchaImage(localStorage.getItem('base64Url'));
}
@@ -370,6 +372,8 @@ const CustomFormWizard = (props) => {
checkDigit: values.checkDigit,
tncFlag: tncFlag,
type: "IND",
captcha: base64Url,
checkCode: checkCode
};

var formData = new FormData();
@@ -1626,6 +1630,7 @@ const CustomFormWizard = (props) => {
onChange={(event) => {
const value = event.target.value;
props.setCheckCode(event.target.value);
setCheckCode(event.target.value);
formik.setFieldValue("captchaField", value);
}}
sx={{ width: '75%' }}


+ 8
- 1
src/pages/authentication/auth-forms/IAmSmartFormWizard.js Vedi File

@@ -71,6 +71,9 @@ const CustomFormWizard = (props) => {
const [showId, setshowId] = useState(false);
const [showComId, setshowComId] = useState(false);

const [base64Url, setBase64Url] = useState("")
const [checkCode, setCheckCode] = useState("")

useEffect(() => {
location.state?.responseData ?? {}
if (captchaImg == "")
@@ -227,6 +230,7 @@ const CustomFormWizard = (props) => {
params: { width: 130, height: 40, captcha: captchaImg },
onSuccess: (responseData) => {
props.setBase64Url(responseData.base64Url)
setBase64Url(responseData.base64Url)
localStorage.setItem("base64Url", responseData.base64Url);
setCaptchaImage(localStorage.getItem('base64Url'));
}
@@ -328,7 +332,9 @@ const CustomFormWizard = (props) => {
type: "IND",
userFaxNo: JSON.stringify(userFaxNo),
userMobileNumber: JSON.stringify(userMobileNumber),
userAddress: JSON.stringify(userAddress)
userAddress: JSON.stringify(userAddress),
captcha: base64Url,
checkCode: checkCode
};

if (isValid) {
@@ -925,6 +931,7 @@ const CustomFormWizard = (props) => {
onChange={(event) => {
const value = event.target.value;
props.setCheckCode(event.target.value);
setCheckCode(event.target.value);
formik.setFieldValue("captchaField", value);
}}
sx={{ width: '75%' }}


Caricamento…
Annulla
Salva