为什么现在SmartEdit中不允许使用gif-s,尽管配置中有不同的说明:
public ACCEPTED_FILE_TYPES: string[] = [
'jpeg',
'jpg',
'gif',
'bmp',
'tiff',
'tif',
'png',
'svg'
];smartedit会显示错误消息:“选定的文件类型无效”,但是我们可以通过后台轻松添加.gif文件。我们使用hybry19.05版本。
发布于 2020-11-26 18:00:41
这是1905年Hybris版本的一个已知错误。如果您将其升级到2005或2011版本,它将被修复,以下是针对该bug的jira的链接:
https://cxjira.sap.com/browse/ECP-4148
作为@gif has mentioned,如果您不想进行升级,您可以在angular配置文件类型上添加智能编辑接受的РоманЛотоцький的mime类型来修复它:
474946383961为业务团队上传图片的mime类型码
$HYBRIS/hybris/bin/custom/myBestextension/web/features/myBestextensionContainer directory.
angular.module('myBestextensionMimeTypeModule',[])
- Copy the existing mime type codes defined in cmssmartedit to your myBestextensionMimeTypeModule in myBestextensionMimeType.js. The list you define in myBestextensionMimeType.js overrides the existing list defined in seFileMimeTypeServiceConstants constant in cmssmartedit. You copy the list to retain the current values so that you can add to them.- Append additional new mime types to the list of values in myBestextensionMimeType.js.下面来自myBestextensionMimeType.js的代码示例显示了从cmssmartedit复制的mime类型代码以及您添加到列表中的新mime类型:
angular.module('myBestextensionMimeTypeModule',[]) .constant('seFileMimeTypeServiceConstants',{ VALID_IMAGE_MIME_TYPE_CODES:'FFD8FFDB','FFD8FFE0','FFD8FFE1','474946383761','424D','49492A00','4D4D002A','89504E470D0A1A0A',//在这里插入额外的mime类型代码'474946383961‘// GIF89a的mime类型代码示例};
$HYBRIS/hybris/bin/custom/myBestextension/web/features/myBestextensionContainer/myBestextensioncontainerModule.ts,如下例所示:@SeModule({ ...imports:'smarteditServicesModule','abAnalyticsToolbarItemModule',//在这里导入新模块'myBestextensionMimeTypeModule',})导出类MyBestextensionContainer {}
根容器是<custom-extension-name>containerModules.ts。在我们的示例中,根容器是myBestextensioncontainerModule.ts.
cd $HYBRIS/hybris/bin/custom/myBestextension ant build
发布于 2020-11-25 18:44:27
我将这个数字474946383961添加到有效的图像mime类型中,这很有帮助。
公共VALID_IMAGE_MIME_TYPE_CODES: string[] = 'FFD8FFDB','FFD8FFE0','FFD8FFE1','474946383761','474946383961',// gif幻数'424D','49492A00','4D4D002A','89504E470D0A1A0A','3C3F786D6C207665','3C73766720786D6C‘;
https://stackoverflow.com/questions/64984087
复制相似问题