Skip to content

Commit a83b55e

Browse files
committed
fix form
1 parent 0107527 commit a83b55e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

mobile-ui/src/components/form/captcha.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ const FormCaptcha: React.FC<FormItemProps> = (props) => {
1010

1111
const reloadCaptcha = () => {
1212
props.onCaptchaRefresh && props.onCaptchaRefresh().then((res) => {
13-
setCaptchaImg(res.url);
14-
props.onCaptchaChange && props.onCaptchaChange(res.code);
13+
if(res) {
14+
setCaptchaImg(res.url);
15+
props.onCaptchaChange && props.onCaptchaChange(res.code);
16+
}
1517
});
1618
}
1719

mobile-ui/src/components/form/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export interface FormItemProps {
139139
code: string;
140140
// 验证码图片地址
141141
url: string;
142-
}>;
142+
} | null>;
143143
// 文件上传事件
144144
onUploaderUpload?: (filename: string, base64: string) => Promise<{
145145
// 文件id

0 commit comments

Comments
 (0)