From 2d61615e719ba8de4ee510d53079a07e40418e90 Mon Sep 17 00:00:00 2001 From: ronger Date: Mon, 21 Sep 2020 08:31:31 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=97=A0=E6=A0=87=E7=AD=BE=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E6=97=A0=E6=B3=95=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/rymcu/vertical/service/impl/ArticleServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rymcu/vertical/service/impl/ArticleServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/ArticleServiceImpl.java index 0aa5f2a..94124f3 100644 --- a/src/main/java/com/rymcu/vertical/service/impl/ArticleServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/service/impl/ArticleServiceImpl.java @@ -232,9 +232,11 @@ public class ArticleServiceImpl extends AbstractService
implements Arti public Map delete(Integer id) { Map map = new HashMap(1); Integer result; + Article article = articleMapper.selectByPrimaryKey(id); // 删除引用标签记录 result = articleMapper.deleteTagArticle(id); - if (result > 0) { + // 无标签情况下无法删除文章问题修复 + if (result > 0 || StringUtils.isBlank(article.getArticleTags())) { result = articleMapper.deleteByPrimaryKey(id); if (result < 1) { map.put("message", "删除失败!");