Kaynağa Gözat

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

master
牧羊人 4 yıl önce
ebeveyn
işleme
f9789c7c72
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  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 Dosyayı Görüntüle

@@ -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()) {

Yükleniyor…
İptal
Kaydet