mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 15:01:23 +08:00
Optimized power management
This commit is contained in:
@@ -38,7 +38,7 @@ public class GroupController {
|
||||
|
||||
@Operation(summary = "获取所有用户组")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:group:all', 'system:group:add', 'system:group:delete', 'system:group:modify', 'system:user:add', 'system:user:modify')")
|
||||
@PreAuthorize("hasAnyAuthority('system:group:get', 'system:group:add', 'system:group:delete', 'system:group:modify', 'system:user:add', 'system:user:modify')")
|
||||
public ResponseResult<List<Group>> getAllGroup() {
|
||||
List<Group> groups = groupService.getAllGroup();
|
||||
return ResponseResult.databaseSelectSuccess(groups);
|
||||
|
||||
@@ -39,7 +39,7 @@ public class RoleController {
|
||||
|
||||
@Operation(summary = "获取所有角色")
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:role:all', 'system:role:add', 'system:role:delete', 'system:role:modeify', 'system:group:add', 'system:group:modify', 'system:user:add', 'system:user:modify')")
|
||||
@PreAuthorize("hasAnyAuthority('system:role:get', 'system:role:add', 'system:role:delete', 'system:role:modeify', 'system:group:add', 'system:group:modify', 'system:user:add', 'system:user:modify')")
|
||||
public ResponseResult<List<Role>> getAllRole() {
|
||||
List<Role> roles = roleService.getAllRole();
|
||||
return ResponseResult.databaseSelectSuccess(roles);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class UserController {
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@PreAuthorize("hasAnyAuthority('system:user:all', 'system:user:add', 'system:user:modify')")
|
||||
@PreAuthorize("hasAnyAuthority('system:user:get', 'system:user:add', 'system:user:modify')")
|
||||
@Operation(summary = "获取所有用户(权限管理相关)")
|
||||
public ResponseResult<List<User>> getAllUser() {
|
||||
List<User> users = userService.getAllUser();
|
||||
|
||||
106
sql/Insert.sql
106
sql/Insert.sql
@@ -122,30 +122,30 @@ commit;
|
||||
|
||||
begin;
|
||||
insert into t_power(id, type_id)
|
||||
values (2020105, 3);
|
||||
values (2020151, 3);
|
||||
insert into t_operation(id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (2020105, '获取所有工作事项(管理)', 'work:admin:get', id, 2020100, null);
|
||||
VALUES (2020151, '获取所有工作事项(管理)', 'work:admin:get', id, 2020100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power(id, type_id)
|
||||
values (2020106, 3);
|
||||
values (2020152, 3);
|
||||
insert into t_operation(id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (2020106, '添加工作事项(管理)', 'work:admin:add', id, 2020100, null);
|
||||
VALUES (2020152, '添加工作事项(管理)', 'work:admin:add', id, 2020100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power(id, type_id)
|
||||
values (2020107, 3);
|
||||
values (2020153, 3);
|
||||
insert into t_operation(id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (2020107, '删除工作事项(管理)', 'work:admin:delete', id, 2020100, null);
|
||||
VALUES (2020153, '删除工作事项(管理)', 'work:admin:delete', id, 2020100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power(id, type_id)
|
||||
values (2020108, 3);
|
||||
values (2020154, 3);
|
||||
insert into t_operation(id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (2020108, '修改工作事项(管理)', 'work:admin:modify', id, 2020100, null);
|
||||
VALUES (2020154, '修改工作事项(管理)', 'work:admin:modify', id, 2020100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
@@ -381,6 +381,90 @@ commit;
|
||||
|
||||
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (98010000, 1);
|
||||
insert into t_menu (id, name, url, power_id, parent_id)
|
||||
VALUES (98010000, '部门管理', '/info/department', id, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (98010100, 2);
|
||||
insert into t_element (id, name, power_id, menu_id)
|
||||
VALUES (98010100, '列表', id, 98010000);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (98010101, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (98010101, '查看所有部门', 'department:admin:get', id, 98010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (98010102, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (98010102, '增加部门', 'department:admin:add', id, 98010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (98010103, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (98010103, '删除部门', 'department:admin:delete', id, 98010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (98010104, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (98010104, '修改部门', 'department:admin:modify', id, 98010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (99010000, 1);
|
||||
insert into t_menu (id, name, url, power_id, parent_id)
|
||||
VALUES (99010000, '员工信息管理', '/info/staff', id, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (99010100, 2);
|
||||
insert into t_element (id, name, power_id, menu_id)
|
||||
VALUES (99010100, '列表', id, 99010000);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (99010101, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (99010101, '查看部门员工信息', 'staff:manege:get', id, 99010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (99010102, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (99010102, '修改部门员工信息', 'staff:manege:modify', id, 99010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (99010151, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (99010151, '修改员工信息(管理)', 'staff:admin:get', id, 99010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (99010152, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (99010152, '修改员工信息(管理)', 'staff:admin:modify', id, 99010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (101010000, 1);
|
||||
@@ -399,7 +483,7 @@ begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (101010101, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (101010101, '查询所有角色', 'system:role:all', id, 101010100, null);
|
||||
VALUES (101010101, '查询所有角色', 'system:role:get', id, 101010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
@@ -441,7 +525,7 @@ begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (102010101, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (102010101, '查询所有用户组', 'system:group:all', id, 102010100, null);
|
||||
VALUES (102010101, '查询所有用户组', 'system:group:get', id, 102010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
@@ -483,7 +567,7 @@ begin;
|
||||
insert into t_power (id, type_id)
|
||||
values (103010101, 3);
|
||||
insert into t_operation (id, name, code, power_id, element_id, parent_id)
|
||||
VALUES (103010101, '查看所有用户', 'system:user:all', id, 103010100, null);
|
||||
VALUES (103010101, '查看所有用户', 'system:user:get', id, 103010100, null);
|
||||
commit;
|
||||
|
||||
begin;
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
v-model="groupForm.inputGroupName"
|
||||
maxlength="30"
|
||||
placeholder="请输入名称"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户组角色">
|
||||
@@ -70,7 +71,7 @@
|
||||
<el-button type="primary" @click="handleSubmit" :disabled="dialogLoading"
|
||||
>提交</el-button
|
||||
>
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
<el-button @click="handleCancel" :disabled="dialogLoading">取消</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -107,10 +108,6 @@ export default {
|
||||
{
|
||||
required: true,
|
||||
message: '用户组名称为必填项'
|
||||
},
|
||||
{
|
||||
max: 30,
|
||||
message: '用户组不能大于30个字符'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
v-model="roleForm.inputRoleName"
|
||||
maxlength="20"
|
||||
placeholder="请输入名称"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色权限">
|
||||
@@ -74,7 +75,7 @@
|
||||
<el-button type="primary" @click="handleSubmit" :disabled="dialogLoading"
|
||||
>提交</el-button
|
||||
>
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
<el-button @click="handleCancel" :disabled="dialogLoading">取消</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -117,10 +118,6 @@ export default {
|
||||
{
|
||||
required: true,
|
||||
message: '角色名称为必填项'
|
||||
},
|
||||
{
|
||||
max: 20,
|
||||
message: '角色名称不能大于20个字符'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
placeholder="请输入用户名"
|
||||
minlength="3"
|
||||
maxlength="20"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="inputPassword" :required="isAddNew">
|
||||
@@ -102,7 +103,7 @@
|
||||
<el-button type="primary" @click="handleSubmit" :disabled="dialogLoading"
|
||||
>提交</el-button
|
||||
>
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
<el-button @click="handleCancel" :disabled="dialogLoading">取消</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -153,10 +154,6 @@ export default {
|
||||
{
|
||||
min: 3,
|
||||
message: '用户名必须大于3个字符'
|
||||
},
|
||||
{
|
||||
max: 20,
|
||||
message: '用户名不能大于20个字符'
|
||||
}
|
||||
],
|
||||
inputPassword: [
|
||||
@@ -167,10 +164,6 @@ export default {
|
||||
{
|
||||
min: 8,
|
||||
message: '密码必须大于8个字符'
|
||||
},
|
||||
{
|
||||
max: 64,
|
||||
message: '密码不能大于64个字符'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const powerRouter = {
|
||||
path: '/power',
|
||||
name: 'systemManagement',
|
||||
name: 'powerManagement',
|
||||
redirect: '/power/role',
|
||||
children: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user