fix(系统设置): 工作空间菜单下点击项目成员数被重定向

--bug=1013957 --user=李玉号 【系统设置】工作空间管理员权限,点击成员数跳转不了
https://www.tapd.cn/55049933/s/1181120
This commit is contained in:
shiziyuan9527 2022-06-14 14:43:46 +08:00 committed by 刘瑞斌
parent 3806dcf20b
commit 8e1153e4d3
2 changed files with 10 additions and 2 deletions

View File

@ -154,7 +154,7 @@ public class UserController {
}
@PostMapping("/project/member/list/{goPage}/{pageSize}")
@RequiresPermissions(PermissionConstants.PROJECT_USER_READ)
@RequiresPermissions(value = {PermissionConstants.PROJECT_USER_READ, PermissionConstants.WORKSPACE_USER_READ}, logical = Logical.OR)
public Pager<List<User>> getProjectMemberList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryMemberRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, userService.getProjectMemberList(request));

View File

@ -140,7 +140,7 @@
<script>
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableOperator from "../../common/components/MsTableOperator";
import {getCurrentProjectID, getCurrentUserId, getCurrentWorkspaceId} from "@/common/js/utils";
import {getCurrentProjectID, getCurrentUser, getCurrentWorkspaceId} from "@/common/js/utils";
import {getUrl, LOG_MODULE_MAP, LOG_TYPE, LOG_TYPE_MAP, SYSLIST, WORKSYSLIST} from "./config";
import MsLogDetail from "./LogDetail";
@ -242,6 +242,14 @@ export default {
if (resourceId instanceof Array) {
resourceId = resourceId[0];
}
if (!this.isSystem) {
let user = getCurrentUser();
let permission = user.userGroups.filter(ug => ug.sourceId === resource.projectId);
if (!permission || (Array.isArray(permission) && permission.length === 0)) {
this.$warning(this.$t("commons.no_operation_permission"));
return;
}
}
this.$get('/user/update/currentByResourceId/' + resourceId, () => {
this.toPage(uri);
});