瀏覽代碼

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

master
牧羊人 4 年之前
父節點
當前提交
f9789c7c72
共有 1 個文件被更改,包括 2 次插入2 次删除
  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 查看文件

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

Loading…
取消
儲存