From fb8c1fbb5f238a45f7183ee4ced79dc01ac0d416 Mon Sep 17 00:00:00 2001 From: shuai Date: Tue, 16 May 2023 17:59:08 +0800 Subject: [PATCH] fix: refresh auth code shen show authcode modal --- ui/src/components/Modal/PicAuthCodeModal.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/src/components/Modal/PicAuthCodeModal.tsx b/ui/src/components/Modal/PicAuthCodeModal.tsx index 3de920e9..a4ff6acc 100644 --- a/ui/src/components/Modal/PicAuthCodeModal.tsx +++ b/ui/src/components/Modal/PicAuthCodeModal.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { useEffect } from 'react'; import { Modal, Form, Button, InputGroup } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; @@ -30,6 +30,13 @@ const Index: React.FC = ({ }) => { const { t } = useTranslation('translation', { keyPrefix: 'pic_auth_code' }); const { captcha, imgCode } = data; + + useEffect(() => { + if (visible) { + refreshImgCode(); + } + }, [visible]); + return (