mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 11:12:20 +08:00
fix(plugin-fm): fix page crash when 413 in local dev (#4560)
This commit is contained in:
parent
2dfa7a2625
commit
8cc5ad2abf
@ -115,8 +115,13 @@ export const getThumbURL = (target: any) => {
|
|||||||
|
|
||||||
export function getResponseMessage({ error, response }: UploadFile<any>) {
|
export function getResponseMessage({ error, response }: UploadFile<any>) {
|
||||||
if (error instanceof Error && 'isAxiosError' in error) {
|
if (error instanceof Error && 'isAxiosError' in error) {
|
||||||
|
// @ts-ignore
|
||||||
|
if (error.response) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return error.response.data?.errors?.map?.((item) => item?.message).join(', ');
|
return error.response.data?.errors?.map?.((item) => item?.message).join(', ');
|
||||||
|
} else {
|
||||||
|
return error.message;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!response) {
|
if (!response) {
|
||||||
return '';
|
return '';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user