refactor: unify workspace ID retrieval in authorization API calls
--bug=1058173 --user=刘瑞斌 【资源授权】工作空间管理员进入资源授权查看提示没有权限,工作空间显示为空 https://www.tapd.cn/62980211/s/1724774
This commit is contained in:
parent
6e012e6469
commit
348e588428
@ -244,9 +244,9 @@ function submitPermissions() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
.reduce((pre: any, next: any) => [...pre, ...next], [])
|
.reduce((pre: any, next: any) => [...pre, ...next], [])
|
||||||
|
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
|
||||||
AuthorizationApi.putResourceAuthorization(
|
AuthorizationApi.putResourceAuthorization(
|
||||||
currentWorkspaceId.value || 'default',
|
workspaceId,
|
||||||
currentUser.value,
|
currentUser.value,
|
||||||
(route.meta?.resource as string) || 'APPLICATION',
|
(route.meta?.resource as string) || 'APPLICATION',
|
||||||
{ user_resource_permission_list: user_resource_permission_list },
|
{ user_resource_permission_list: user_resource_permission_list },
|
||||||
@ -264,7 +264,8 @@ function clickMemberHandle(item: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getMember(id?: string) {
|
function getMember(id?: string) {
|
||||||
AuthorizationApi.getUserMember(currentWorkspaceId.value || 'default', loading).then((res) => {
|
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
|
||||||
|
AuthorizationApi.getUserMember(workspaceId, loading).then((res) => {
|
||||||
memberList.value = res.data
|
memberList.value = res.data
|
||||||
filterMember.value = res.data
|
filterMember.value = res.data
|
||||||
if (memberList.value.length > 0) {
|
if (memberList.value.length > 0) {
|
||||||
@ -352,16 +353,18 @@ const dfsFolder = (arr: any[] = [], folderIdMap: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getFolder() {
|
function getFolder() {
|
||||||
|
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
|
||||||
return AuthorizationApi.getSystemFolder(
|
return AuthorizationApi.getSystemFolder(
|
||||||
currentWorkspaceId.value || 'default',
|
workspaceId,
|
||||||
activeData.value.type,
|
activeData.value.type,
|
||||||
{},
|
{},
|
||||||
loading,
|
loading,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
function getResourcePermissions(user_id: string) {
|
function getResourcePermissions(user_id: string) {
|
||||||
|
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
|
||||||
return AuthorizationApi.getResourceAuthorization(
|
return AuthorizationApi.getResourceAuthorization(
|
||||||
currentWorkspaceId.value || 'default',
|
workspaceId,
|
||||||
user_id,
|
user_id,
|
||||||
(route.meta?.resource as string) || 'APPLICATION',
|
(route.meta?.resource as string) || 'APPLICATION',
|
||||||
rLoading,
|
rLoading,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user