Merge branch 'feat/ui-0.5.0' of git.backyard.segmentfault.com:opensource/answer into feat/ui-0.5.0

This commit is contained in:
haitao(lj) 2022-11-28 16:50:11 +08:00
commit cb1b7f7f23
3 changed files with 3 additions and 11 deletions

View File

@ -84,17 +84,9 @@ const Index: FC<IProps> = ({ visible = false, callback }) => {
setModalState(false);
})
.catch((err) => {
// if (err.isError && err.key) {
// formData[err.key].isInvalid = true;
// formData[err.key].errorMsg = err.value;
// if (err.key.indexOf('captcha') < 0) {
// setModalState(false);
// }
// }
if (err.isError) {
const data = handleFormError(err, formData);
if (err.list.filter((v) => v.error_field.indexOf('captcha') < 0)) {
if (!err.list.find((v) => v.error_field.indexOf('captcha') >= 0)) {
setModalState(false);
}
setFormData({ ...data });

View File

@ -86,7 +86,7 @@ const Index: FC = () => {
.catch((err) => {
if (err.isError) {
const data = handleFormError(err, formData);
if (err.list.filter((v) => v.error_field.indexOf('captcha') < 0)) {
if (!err.list.find((v) => v.error_field.indexOf('captcha') >= 0)) {
setModalState(false);
}
setFormData({ ...data });

View File

@ -131,7 +131,7 @@ const Index: React.FC = () => {
// }
if (err.isError) {
const data = handleFormError(err, formData);
if (err.list.filter((v) => v.error_field.indexOf('captcha') < 0)) {
if (!err.list.find((v) => v.error_field.indexOf('captcha') >= 0)) {
setModalState(false);
}
setFormData({ ...data });