Skip to content

Commit

Permalink
feat: show geetest_challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
usharerose committed Jul 20, 2024
1 parent 7c9bd40 commit 87a3689
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function App() {

const [showCaptchaModal, setShowCaptchaModal] = useState(false);

const [geetestChallenge, setGeetestChallenge] = useState<string | null>(null);
const [geetestValidate, setGeetestValidate] = useState<string | null>(null);
const [geetestSeccode, setGeetestSeccode] = useState<string | null>(null);

Expand All @@ -38,6 +39,7 @@ export default function App() {
const handler: InitGeetestCallback = (captchaObj: GeetestCaptchaObj) => {
captchaObj.onSuccess(() => {
const result = captchaObj.getValidate();
setGeetestChallenge(result.geetest_challenge);
setGeetestValidate(result.geetest_validate);
setGeetestSeccode(result.geetest_seccode);
});
Expand Down Expand Up @@ -65,7 +67,7 @@ export default function App() {
}, handler);
};

const result = `const validate: string = '${geetestValidate}';\nconst seccode: string = '${geetestSeccode}';`;
const result = `const challenge: string = '${geetestChallenge}';\nconst validate: string = '${geetestValidate}';\nconst seccode: string = '${geetestSeccode}';`;

return (
<div className="login-main">
Expand Down

0 comments on commit 87a3689

Please sign in to comment.