diff --git a/core/backend/src/main/java/io/dataease/service/staticResource/StaticResourceService.java b/core/backend/src/main/java/io/dataease/service/staticResource/StaticResourceService.java index 4353e96783..abb77ae4a4 100644 --- a/core/backend/src/main/java/io/dataease/service/staticResource/StaticResourceService.java +++ b/core/backend/src/main/java/io/dataease/service/staticResource/StaticResourceService.java @@ -60,16 +60,15 @@ public class StaticResourceService { } private boolean isImage(MultipartFile file) { - BufferedImage image = null; try (InputStream input = file.getInputStream()) { - image = ImageIO.read(input); + ImageIO.read(input); } catch (IOException e) { LogUtil.error(e.getMessage(), e); return false; } - Pattern pattern = Pattern.compile("\\.(png|jpg|jpeg|gif)$"); + Pattern pattern = Pattern.compile("\\.(png|jpg|jpeg|gif|svg)$"); Matcher matcher = pattern.matcher(file.getOriginalFilename().toLowerCase()); - if (image == null || image.getWidth() <= 0 || image.getHeight() <= 0 || !matcher.find()) { + if (!matcher.find()) { return false; } diff --git a/core/frontend/src/lang/en.js b/core/frontend/src/lang/en.js index cb4c82c467..934c318c46 100644 --- a/core/frontend/src/lang/en.js +++ b/core/frontend/src/lang/en.js @@ -2064,7 +2064,7 @@ export default { panel_cache_use_tips: 'It was checked that the last dashboard could not be saved normally. Do you want to use the panel that was not saved last time?', template_name_tips: 'Panel\'s name should not be null', panel_background_item: 'Customize panel background', - panel_background_image_tips: 'Currently.Jpeg,.Jpg,.Png,.Gif files are supported, and the size should not exceed 15m', + panel_background_image_tips: 'Currently Jpeg,Jpg,Png,Gif,Svg files are supported, and the size should not exceed 15m', reUpload: 'reUpload', create_by: 'Create By', create_time: 'Create Time', diff --git a/core/frontend/src/lang/tw.js b/core/frontend/src/lang/tw.js index a3e68196c2..d940fefc30 100644 --- a/core/frontend/src/lang/tw.js +++ b/core/frontend/src/lang/tw.js @@ -2058,7 +2058,7 @@ export default { panel_cache_use_tips: '檢查到上次有儀表板未能正常保存,是否使用上次未保存的儀表板?', template_name_tips: '儀表板名稱必填', panel_background_item: '自定義儀表板背景', - panel_background_image_tips: '當前支持.jpeg,.jpg,.png,.gif文件,大小不要超過15M', + panel_background_image_tips: '當前支持jpeg,jpg,png,gif,svg文件,大小15M内', reUpload: '重新上傳', create_by: '創建人', create_time: '創建時間', diff --git a/core/frontend/src/lang/zh.js b/core/frontend/src/lang/zh.js index 1a24eb0521..818a608ef0 100644 --- a/core/frontend/src/lang/zh.js +++ b/core/frontend/src/lang/zh.js @@ -2058,7 +2058,7 @@ export default { panel_cache_use_tips: '检查到上次有仪表板未能正常保存,是否使用上次未保存的仪表板?', template_name_tips: '仪表板名称必填', panel_background_item: '自定义仪表板背景', - panel_background_image_tips: '当前支持.jpeg,.jpg,.png,.gif文件,大小不要超过15M', + panel_background_image_tips: '当前支持jpeg,jpg,png,gif,svg文件,大小15M内', reUpload: '重新上传', create_by: '创建人', create_time: '创建时间', diff --git a/core/frontend/src/views/background/BackgroundOverall.vue b/core/frontend/src/views/background/BackgroundOverall.vue index cfc7e9cf94..a6bd5e5f85 100644 --- a/core/frontend/src/views/background/BackgroundOverall.vue +++ b/core/frontend/src/views/background/BackgroundOverall.vue @@ -110,7 +110,7 @@