mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:36:05 +00:00
fix(plugin-fm): fix thumbnail rule (#4707)
This commit is contained in:
parent
283f1d6000
commit
5ad3a854c5
@ -106,7 +106,13 @@ function AttachmentListItem(props) {
|
||||
|
||||
const item = [
|
||||
<span key="thumbnail" className={`${prefixCls}-list-item-thumbnail`}>
|
||||
{file.imageUrl && <img src={file.imageUrl} alt={file.title} className={`${prefixCls}-list-item-image`} />}
|
||||
{file.imageUrl && (
|
||||
<img
|
||||
src={`${file.imageUrl}${file.thumbnailRule || ''}`}
|
||||
alt={file.title}
|
||||
className={`${prefixCls}-list-item-image`}
|
||||
/>
|
||||
)}
|
||||
</span>,
|
||||
<span key="title" className={`${prefixCls}-list-item-name`} title={file.title}>
|
||||
{file.status === 'uploading' ? t('Uploading') : file.title}
|
||||
|
@ -15,6 +15,9 @@ export class FileModel extends Model {
|
||||
const fileStorages = this.constructor['database']?.['_fileStorages'];
|
||||
if (json.storageId && fileStorages && fileStorages.has(json.storageId)) {
|
||||
const storage = fileStorages.get(json.storageId);
|
||||
if (storage?.options?.thumbnailRule) {
|
||||
json['thumbnailRule'] = storage?.options?.thumbnailRule;
|
||||
}
|
||||
if (storage?.type === 'local' && process.env.APP_PUBLIC_PATH) {
|
||||
json['url'] = process.env.APP_PUBLIC_PATH.replace(/\/$/g, '') + json.url;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user