mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: encode (#6464)
This commit is contained in:
parent
4269ff7412
commit
cc524c45fe
@ -205,6 +205,10 @@ function encodeFileURL(url: string): string {
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (url.includes('X-Amz-Content-Sha256')) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
const parts = url.split('/');
|
const parts = url.split('/');
|
||||||
const filename = parts.pop();
|
const filename = parts.pop();
|
||||||
parts.push(encodeURIComponent(filename));
|
parts.push(encodeURIComponent(filename));
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
import { isArr, isValid, toArr as toArray } from '@formily/shared';
|
import { isArr, isValid, toArr as toArray } from '@formily/shared';
|
||||||
import { UploadFile } from 'antd/es/upload/interface';
|
import { UploadFile } from 'antd/es/upload/interface';
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import mime from 'mime';
|
import mime from 'mime';
|
||||||
import match from 'mime-match';
|
import match from 'mime-match';
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useAPIClient } from '../../../api-client';
|
import { useAPIClient } from '../../../api-client';
|
||||||
import { UNKNOWN_FILE_ICON, UPLOAD_PLACEHOLDER } from './placeholder';
|
import { UNKNOWN_FILE_ICON, UPLOAD_PLACEHOLDER } from './placeholder';
|
||||||
import type { IUploadProps, UploadProps } from './type';
|
import type { IUploadProps, UploadProps } from './type';
|
||||||
@ -273,6 +273,10 @@ export function encodeFileURL(url: string): string {
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (url.includes('X-Amz-Content-Sha256')) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
const [base, search = ''] = url.split('?');
|
const [base, search = ''] = url.split('?');
|
||||||
const parts = base.split('/');
|
const parts = base.split('/');
|
||||||
const filename = parts.pop();
|
const filename = parts.pop();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user