Browse Source

若依3.3

pull/81/MERGE v3.3
RuoYi 6 years ago
parent
commit
7913796730
  1. 5
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java

5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java

@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.AjaxResult.Type;
import com.ruoyi.common.core.domain.Ztree;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
@ -114,11 +113,11 @@ public class SysDeptController extends BaseController
{
if (deptService.selectDeptCount(deptId) > 0)
{
return error(Type.WARN, "存在下级部门,不允许删除");
return AjaxResult.warn("存在下级部门,不允许删除");
}
if (deptService.checkDeptExistUser(deptId))
{
return error(Type.WARN, "部门存在用户,不允许删除");
return AjaxResult.warn("部门存在用户,不允许删除");
}
return toAjax(deptService.deleteDeptById(deptId));
}

5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java

@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.AjaxResult.Type;
import com.ruoyi.common.core.domain.Ztree;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.util.ShiroUtils;
@ -62,11 +61,11 @@ public class SysMenuController extends BaseController
{
if (menuService.selectCountMenuByParentId(menuId) > 0)
{
return error(Type.WARN, "存在子菜单,不允许删除");
return AjaxResult.warn("存在子菜单,不允许删除");
}
if (menuService.selectCountRoleMenuByMenuId(menuId) > 0)
{
return error(Type.WARN, "菜单已分配,不允许删除");
return AjaxResult.warn("菜单已分配,不允许删除");
}
ShiroUtils.clearCachedAuthorizationInfo();
return toAjax(menuService.deleteMenuById(menuId));

Loading…
Cancel
Save