From d9ffe20121cf743cd206dfacb26297aa53c23d0d Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Sat, 12 Aug 2023 21:17:50 +0800 Subject: [PATCH] Fix the interface logic for dept details (#201) * Fix the interface logic for dept details --- backend/app/services/dept_service.py | 2 -- backend/app/services/menu_service.py | 1 + backend/sql/init_test_data.sql | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/app/services/dept_service.py b/backend/app/services/dept_service.py index 8d8572d2..4c0b3a39 100644 --- a/backend/app/services/dept_service.py +++ b/backend/app/services/dept_service.py @@ -14,8 +14,6 @@ class DeptService: dept = await DeptDao.get(db, pk) if not dept: raise errors.NotFoundError(msg='部门不存在') - if not dept.status: - raise errors.ForbiddenError(msg='部门已关停') return dept @staticmethod diff --git a/backend/app/services/menu_service.py b/backend/app/services/menu_service.py index aabb5573..c737acff 100644 --- a/backend/app/services/menu_service.py +++ b/backend/app/services/menu_service.py @@ -41,6 +41,7 @@ class MenuService: async with async_db_session() as db: roles = request.user.roles menu_ids = [] + menu_tree = [] if roles: for role in roles: menu_ids.extend([menu.id for menu in role.menus]) diff --git a/backend/sql/init_test_data.sql b/backend/sql/init_test_data.sql index 603d144a..2d9934b6 100644 --- a/backend/sql/init_test_data.sql +++ b/backend/sql/init_test_data.sql @@ -10,7 +10,7 @@ values (1, '测试', 'test', 0, 0, '', null, 0, null, null, 0, 0, 1, null, null (6, '登录日志', 'Login', 0, 0, null, 'login', 1, '/log/login/index.vue', null, 1, 1, 1, null, 5, '2023-07-27 19:20:56', null), (7, '操作日志', 'Opera', 0, 0, null, 'opera', 1, '/log/opera/index.vue', null, 1, 1, 1, null, 5, '2023-07-27 19:21:28', null), (8, '常见问题', 'faq', 0, 999, 'IconQuestion', 'https://arco.design/vue/docs/pro/faq', 1, null, null, 1, 1, 1, null, null, '2023-07-27 19:22:24', null), - (9, '系统管理', 'admin', 0, 6, 'IconSettings', 'admin', 1, null, null, 1, 1, 1, null, null, '2023-07-27 19:23:00', null), + (9, '系统管理', 'admin', 0, 6, 'IconSettings', 'admin', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:23:00', null), (10, '部门管理', 'SysDept', 0, 0, null, 'sys-dept', 1, '/admin/dept/index.vue', null, 1, 1, 1, null, 9, '2023-07-27 19:23:42', null), (11, 'API管理', 'SysApi', 0, 1, null, 'sys-api', 1, '/admin/api/index.vue', null, 1, 1, 1, null, 9, '2023-07-27 19:24:12', null), (12, '用户管理', 'SysUser', 0, 0, null, 'sys-user', 1, '/admin/user/index.vue', null, 1, 1, 1, null, 9, '2023-07-27 19:25:13', null),