fix(系统设置): 组织项目列表报错问题

--bug=1039449 --user=宋昌昌 【系统设置】组织-项目列表-点击成员报错 https://www.tapd.cn/55049933/s/1498111
This commit is contained in:
song-cc-rock 2024-04-16 11:41:39 +08:00 committed by 刘瑞斌
parent 232cdfec1d
commit e4c69547c5
5 changed files with 2 additions and 12 deletions

View File

@ -84,7 +84,6 @@ public class ProjectTemplateController {
@Operation(summary = "设置默认模板") @Operation(summary = "设置默认模板")
@RequiresPermissions(PermissionConstants.PROJECT_TEMPLATE_UPDATE) @RequiresPermissions(PermissionConstants.PROJECT_TEMPLATE_UPDATE)
@Log(type = OperationLogType.UPDATE, expression = "#msClass.setDefaultTemplateLog(#id)", msClass = ProjectTemplateLogService.class) @Log(type = OperationLogType.UPDATE, expression = "#msClass.setDefaultTemplateLog(#id)", msClass = ProjectTemplateLogService.class)
@CheckProjectOwner(resourceId = "#id", resourceType = "template", resourceCol = "scope_id")
public void setDefaultTemplate(@PathVariable String projectId, @PathVariable String id) { public void setDefaultTemplate(@PathVariable String projectId, @PathVariable String id) {
projectTemplateservice.setDefaultTemplate(projectId, id); projectTemplateservice.setDefaultTemplate(projectId, id);
} }

View File

@ -51,7 +51,6 @@ public class ProjectUserRoleController {
@PostMapping("/list") @PostMapping("/list")
@Operation(summary = "项目管理-项目与权限-用户组-获取用户组列表") @Operation(summary = "项目管理-项目与权限-用户组-获取用户组列表")
@RequiresPermissions(PermissionConstants.PROJECT_GROUP_READ) @RequiresPermissions(PermissionConstants.PROJECT_GROUP_READ)
@CheckProjectOwner(resourceId = "#request.getProjectId()", resourceType = "user_role", resourceCol = "scope_id")
public Pager<List<ProjectUserRoleDTO>> list(@Validated @RequestBody ProjectUserRoleRequest request) { public Pager<List<ProjectUserRoleDTO>> list(@Validated @RequestBody ProjectUserRoleRequest request) {
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize()); Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize());
return PageUtils.setPageInfo(page, projectUserRoleService.list(request)); return PageUtils.setPageInfo(page, projectUserRoleService.list(request));
@ -61,7 +60,6 @@ public class ProjectUserRoleController {
@Operation(summary = "项目管理-项目与权限-用户组-添加用户组") @Operation(summary = "项目管理-项目与权限-用户组-添加用户组")
@RequiresPermissions(PermissionConstants.PROJECT_GROUP_ADD) @RequiresPermissions(PermissionConstants.PROJECT_GROUP_ADD)
@Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = ProjectUserRoleLogService.class) @Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = ProjectUserRoleLogService.class)
@CheckProjectOwner(resourceId = "#request.getScopeId()", resourceType = "user_role", resourceCol = "scope_id")
public UserRole add(@Validated({Created.class}) @RequestBody ProjectUserRoleEditRequest request) { public UserRole add(@Validated({Created.class}) @RequestBody ProjectUserRoleEditRequest request) {
UserRole userRole = new UserRole(); UserRole userRole = new UserRole();
userRole.setCreateUser(SessionUtils.getUserId()); userRole.setCreateUser(SessionUtils.getUserId());
@ -94,7 +92,6 @@ public class ProjectUserRoleController {
@Operation(summary = "项目管理-项目与权限-用户组-获取用户组对应的权限配置") @Operation(summary = "项目管理-项目与权限-用户组-获取用户组对应的权限配置")
@Parameter(name = "id", description = "用户组ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED)) @Parameter(name = "id", description = "用户组ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED))
@RequiresPermissions(PermissionConstants.PROJECT_GROUP_READ) @RequiresPermissions(PermissionConstants.PROJECT_GROUP_READ)
@CheckProjectOwner(resourceId = "#id", resourceType = "user_role", resourceCol = "scope_id")
public List<PermissionDefinitionItem> getPermissionSetting(@PathVariable String id) { public List<PermissionDefinitionItem> getPermissionSetting(@PathVariable String id) {
return projectUserRoleService.getPermissionSetting(id); return projectUserRoleService.getPermissionSetting(id);
} }

View File

@ -92,7 +92,6 @@ public class OrganizationUserRoleController {
@Operation(summary = "系统设置-组织-用户组-获取用户组对应的权限配置") @Operation(summary = "系统设置-组织-用户组-获取用户组对应的权限配置")
@Parameter(name = "id", description = "用户组ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED)) @Parameter(name = "id", description = "用户组ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED))
@RequiresPermissions(PermissionConstants.ORGANIZATION_USER_ROLE_READ) @RequiresPermissions(PermissionConstants.ORGANIZATION_USER_ROLE_READ)
@CheckOrgOwner(resourceId = "#id", resourceType = "user_role", resourceCol = "scope_id")
public List<PermissionDefinitionItem> getPermissionSetting(@PathVariable String id) { public List<PermissionDefinitionItem> getPermissionSetting(@PathVariable String id) {
return organizationUserRoleService.getPermissionSetting(id); return organizationUserRoleService.getPermissionSetting(id);
} }

View File

@ -148,16 +148,11 @@
// //
const systemAdminDisabled = computed(() => { const systemAdminDisabled = computed(() => {
const adminArr = ['admin', 'org_admin', 'project_admin']; const adminArr = ['admin', 'org_admin', 'project_admin'];
const memberArr = ['member', 'org_member', 'project_member'];
const { id } = props.current; const { id } = props.current;
if (adminArr.includes(id)) { if (adminArr.includes(id)) {
// , // ,
return true; return true;
} }
if (memberArr.includes(id)) {
//
return !userStore.isAdmin;
}
return props.disabled; return props.disabled;
}); });

View File

@ -129,7 +129,7 @@
import PreviewTemplate from '@/views/setting/organization/template/components/viewTemplate.vue'; import PreviewTemplate from '@/views/setting/organization/template/components/viewTemplate.vue';
import { import {
deleteOrdTemplate, deleteProjectTemplate,
getProjectFieldList, getProjectFieldList,
getProjectTemplateInfo, getProjectTemplateInfo,
getProjectTemplateList, getProjectTemplateList,
@ -273,7 +273,7 @@
}, },
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
if (record.id) await deleteOrdTemplate(record.id); if (record.id) await deleteProjectTemplate(record.id);
Message.success(t('common.deleteSuccess')); Message.success(t('common.deleteSuccess'));
loadList(); loadList();
} catch (error) { } catch (error) {