fix(file-manager): improve default values for thumbnail rules
This commit is contained in:
parent
0279067d4c
commit
200138350b
@ -95,7 +95,7 @@ ReadPretty.File = function File(props: UploadProps) {
|
||||
>
|
||||
{file.imageUrl && (
|
||||
<img
|
||||
src={`${file.imageUrl}${file.thumbnailRule}`}
|
||||
src={`${file.imageUrl}${file.thumbnailRule || ''}`}
|
||||
alt={file.title}
|
||||
className={`${prefixCls}-list-item-image`}
|
||||
/>
|
||||
|
@ -56,8 +56,9 @@ export default {
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Input',
|
||||
'x-component-props': {
|
||||
placeholder: '?x-oss-process=image/auto-orient,1/resize,m_fill,w_40,h_40/quality,q_90',
|
||||
placeholder: '?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90',
|
||||
},
|
||||
default: '?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90',
|
||||
description: '{{ xStyleProcessDesc }}',
|
||||
},
|
||||
},
|
||||
|
@ -7,6 +7,9 @@ export class FileModel extends Model {
|
||||
if (json.storageId && fileStorages && fileStorages.has(json.storageId)) {
|
||||
const storage = fileStorages.get(json.storageId);
|
||||
json['thumbnailRule'] = storage?.options?.thumbnailRule;
|
||||
if (!json['thumbnailRule'] && storage?.type === 'ali-oss') {
|
||||
json['thumbnailRule'] = '?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90';
|
||||
}
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user