From fec31ae75458e02e0a24d6bb8e501fde272aaa6d Mon Sep 17 00:00:00 2001 From: hupeng Date: Fri, 29 May 2020 23:23:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E8=87=AA?= =?UTF-8?q?=E5=B7=B1=E4=B8=8D=E8=83=BD=E9=80=89=E6=8B=A9=E8=87=AA=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yixiang/modules/shop/rest/StoreCategoryController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java index 22c6b8f2..fa245983 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java @@ -104,6 +104,11 @@ public class StoreCategoryController { if(resources.getPid() > 0 && StrUtil.isBlank(resources.getPic())) { throw new BadRequestException("子分类图片必传"); } + + if(resources.getId().equals(resources.getPid())){ + throw new BadRequestException("自己不能选择自己哦"); + } + boolean checkResult = yxStoreCategoryService.checkCategory(resources.getPid()); if(!checkResult) throw new BadRequestException("分类最多能添加2级哦");