洪城义警-正式版后台
zengh
2021-11-05 b39cc2beacc1ec2e37cff349cae42e420105c8a6
src/main/java/org/springblade/modules/article/controller/ArticleController.java
@@ -12,12 +12,11 @@
import org.springblade.modules.article.entity.Article;
import org.springblade.modules.article.service.ArticleService;
import org.springblade.modules.article.vo.ArticleVo;
import org.springblade.modules.words.DemoApplication;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;
/**
@@ -151,6 +150,12 @@
            article.setCreateTime(new Date());
         }
      }
      if (article.getContent() != null && article.getContent() != ""){
         String content = "";
         content = DemoApplication.interceptWords(article.getContent());
         article.setContent(content);
      }
      article.setUpdateTime(new Date());
      return R.status(articleService.saveOrUpdate(article));
   }