diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/routes/file/FileRouteController.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/routes/file/FileRouteController.java index 05303e3..3372ed7 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/routes/file/FileRouteController.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/controller/routes/file/FileRouteController.java @@ -94,6 +94,23 @@ public class FileRouteController extends AbstractController { return mv; } + /** + * 上传图片版本2 + * + * @return + */ + @GetMapping("uploadimage/v2") + public ModelAndView uploadImageV2() { + Map params = requestParams(); + ModelAndView mv = new ModelAndView("file/image-upload-v2"); + if (!StringUtils.isBlank(params.get("fileId") == null ? null : params.get("fileId").toString())) { + mv.addObject("fileId", params.get("fileId")); + } else { + mv.addObject("fileId", ""); + } + return mv; + } + @ApiOperation(value = "下载文件", notes = "下载文件接口") @ApiImplicitParams({ @ApiImplicitParam(name = "isOpen", value = "是否打开,true和false", paramType = "path"), diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/file/impl/FileServiceImpl.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/file/impl/FileServiceImpl.java index b9e112c..1a4fc41 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/file/impl/FileServiceImpl.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/service/file/impl/FileServiceImpl.java @@ -522,6 +522,9 @@ public class FileServiceImpl extends AbstractService implements IFileService { * @param fileFullPath */ private void compressImage(String fileFullPath) { + if(fileFullPath.endsWith(".blob")) { + return; + } try { Thumbnails.of(fileFullPath).scale(1.0f).outputQuality(fileProperties.getImageOutputQuality()).toFile(fileFullPath); } catch (IOException e) { diff --git a/cloud-common-plugin/src/main/resources/templates/file/image-upload-v2.html b/cloud-common-plugin/src/main/resources/templates/file/image-upload-v2.html new file mode 100644 index 0000000..500406e --- /dev/null +++ b/cloud-common-plugin/src/main/resources/templates/file/image-upload-v2.html @@ -0,0 +1,174 @@ + + + + + + + + + + + +
+
+
+ + +
+
+
+
+
+ + + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cloud-common-plugin/src/main/resources/templates/file/image-upload.html b/cloud-common-plugin/src/main/resources/templates/file/image-upload.html index 3b5680e..1833ca2 100644 --- a/cloud-common-plugin/src/main/resources/templates/file/image-upload.html +++ b/cloud-common-plugin/src/main/resources/templates/file/image-upload.html @@ -25,8 +25,7 @@
- + diff --git a/cloud-common/src/main/java/com/cm/common/service/impl/RbacServiceImpl.java b/cloud-common/src/main/java/com/cm/common/service/impl/RbacServiceImpl.java index 6d0bf88..9832e6a 100644 --- a/cloud-common/src/main/java/com/cm/common/service/impl/RbacServiceImpl.java +++ b/cloud-common/src/main/java/com/cm/common/service/impl/RbacServiceImpl.java @@ -132,11 +132,9 @@ public class RbacServiceImpl implements IRbacService { return true; } List passPaths = accessControl.getPassPaths(); - for (RoleMenuBO roleMenuBO : roleGrantedAuthority.getApiSaveMenu()) { - for (String passPath : passPaths) { - if (antPathMatcher.match(contextPath + roleMenuBO.getApiPrefix() + passPath, uri)) { - return true; - } + for (String passPath : passPaths) { + if (antPathMatcher.match(contextPath + passPath, uri)) { + return true; } } return false;