From 66e0f9a53d471daff7c54f1c091eac297666e38a Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 30 Jul 2021 11:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=AF=E7=94=A8=E9=83=A8=E9=97=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=8E=92=E9=99=A4=E9=A1=B6=E7=BA=A7=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 3 ++- ruoyi-ui/src/utils/request.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index ce25ac5..8931b22 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -209,7 +209,8 @@ public class SysDeptServiceImpl implements ISysDeptService updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); } int result = deptMapper.updateDept(dept); - if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) + if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) + && !StringUtils.equals("0", dept.getAncestors())) { // 如果该部门是启用状态,则启用该部门的所有上级部门 updateParentDeptStatusNormal(dept); diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index 7e2e349..8e8cd1a 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -51,7 +51,7 @@ service.interceptors.response.use(res => { location.href = '/index'; }) }).catch(() => {}); - return Promise.reject('error') + return Promise.reject() } else if (code === 500) { Message({ message: msg,