Pārlūkot izejas kodu

解决通知公告未上传附件报错的问题

master
牧羊人 pirms 4 gadiem
vecāks
revīzija
f9789c7c72
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +2
    -2
      src/main/java/com/taauav/front/service/impl/UserNoticeServiceImpl.java

+ 2
- 2
src/main/java/com/taauav/front/service/impl/UserNoticeServiceImpl.java Parādīt failu

@@ -125,7 +125,7 @@ public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, Use
if (entity == null) {
return response.failure("实体对象不能为空");
}
if (entity.getAttachment().contains("temp")) {
if (!StringUtils.isEmpty(entity.getAttachment()) && entity.getAttachment().contains("temp")) {
String file = entity.getAttachment().replace(uploadUrl, uploadFolder);
File oldFile = new File(file);
if (!oldFile.exists()) {
@@ -168,7 +168,7 @@ public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, Use
if (entity.getId() == null && entity.getId() < 0) {
return response.failure("记录ID不能为空");
}
if (entity.getAttachment().contains("temp")) {
if (!StringUtils.isEmpty(entity.getAttachment()) && entity.getAttachment().contains("temp")) {
String file = entity.getAttachment().replace(uploadUrl, uploadFolder);
File oldFile = new File(file);
if (!oldFile.exists()) {

Notiek ielāde…
Atcelt
Saglabāt