修复登录失败没有提示

This commit is contained in:
whyour 2025-01-29 23:50:46 +08:00
parent 6df651aa63
commit 3ab5b0d86b

View File

@ -57,9 +57,10 @@ const errorHandler = function (
return error.config?.onError(error.response);
}
msg &&
notification.error({
message: msg,
description: (
description: error.response?.data?.errors ? (
<>
{error.response?.data?.errors?.map((item: any) => (
<div>
@ -67,7 +68,7 @@ const errorHandler = function (
</div>
))}
</>
),
) : undefined,
});
}
} else {
@ -117,13 +118,13 @@ _request.interceptors.response.use(async (response) => {
msg &&
notification.error({
message: msg,
description: (
description: res?.errors ? (
<>
{res?.errors.map((item: any) => (
<div>{item.message}</div>
))}
</>
),
) : undefined,
});
}
return res;