diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfile_persion/controller/UpfilePersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfile_persion/controller/UpfilePersionController.java index d262cd33..c46c2e03 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfile_persion/controller/UpfilePersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfile_persion/controller/UpfilePersionController.java @@ -373,9 +373,6 @@ public class UpfilePersionController extends JeecgController loginPageImageUpload(@RequestParam("files") MultipartFile[] file, @RequestParam("flag") String flag) { - if (ObjectUtils.isEmpty(file)) { - return Result.error("请选择文件"); - } return upfilePersionService.logoImageUpload(file,flag); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfile_persion/service/impl/UpfilePersionServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfile_persion/service/impl/UpfilePersionServiceImpl.java index 56719326..39c1eb50 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfile_persion/service/impl/UpfilePersionServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfile_persion/service/impl/UpfilePersionServiceImpl.java @@ -24,6 +24,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.Assert; +import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; import org.springframework.web.multipart.MultipartFile; @@ -401,11 +403,14 @@ public class UpfilePersionServiceImpl @Override public Result logoImageUpload(MultipartFile[] multipartFiles, String flag) { + Assert.notNull(multipartFiles, "请选择文件"); + Assert.notNull(flag, "flag为空"); + MultipartFile file = multipartFiles[0]; // 当前文件的格式 String currentFormat = Objects.requireNonNull(file.getOriginalFilename()).substring(file.getOriginalFilename().lastIndexOf(".") + 1); // 验证格式 - if (!"png".equals(currentFormat)) { + if (!"png".equalsIgnoreCase(currentFormat)) { return Result.error("文件格式不符合要求,请上传.png文件!"); } diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml b/jeecg-boot-master/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml index a5176baa..7a66cbed 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml @@ -306,7 +306,7 @@ third-app: comp: logo-image: - path: /user/local/www/ + path: /user/local/www/comp work: # 作品目录,目录分隔符无论操作系统请用"/",路径末尾一定要有"/" save-path: /opt/jeecgboot/upFiles/comp/zuopin diff --git a/jeecgboot-vue3-master/public/resource/img/comp/comp_logo.png b/jeecgboot-vue3-master/public/resource/img/comp/comp_logo.png index 4f7f8eb9..35ff69e7 100644 Binary files a/jeecgboot-vue3-master/public/resource/img/comp/comp_logo.png and b/jeecgboot-vue3-master/public/resource/img/comp/comp_logo.png differ diff --git a/jeecgboot-vue3-master/src/layouts/default/header/components/user-dropdown/index.vue b/jeecgboot-vue3-master/src/layouts/default/header/components/user-dropdown/index.vue index b7797839..45620e79 100644 --- a/jeecgboot-vue3-master/src/layouts/default/header/components/user-dropdown/index.vue +++ b/jeecgboot-vue3-master/src/layouts/default/header/components/user-dropdown/index.vue @@ -11,7 +11,7 @@