mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-30 17:52:48 +00:00
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], [])
|
||||
|
||||
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
|
||||
AuthorizationApi.putResourceAuthorization(
|
||||
currentWorkspaceId.value || 'default',
|
||||
workspaceId,
|
||||
currentUser.value,
|
||||
(route.meta?.resource as string) || 'APPLICATION',
|
||||
{ user_resource_permission_list: user_resource_permission_list },
|
||||
|
|
@ -264,7 +264,8 @@ function clickMemberHandle(item: any) {
|
|||
}
|
||||
|
||||
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
|
||||
filterMember.value = res.data
|
||||
if (memberList.value.length > 0) {
|
||||
|
|
@ -352,16 +353,18 @@ const dfsFolder = (arr: any[] = [], folderIdMap: any) => {
|
|||
}
|
||||
|
||||
function getFolder() {
|
||||
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
|
||||
return AuthorizationApi.getSystemFolder(
|
||||
currentWorkspaceId.value || 'default',
|
||||
workspaceId,
|
||||
activeData.value.type,
|
||||
{},
|
||||
loading,
|
||||
)
|
||||
}
|
||||
function getResourcePermissions(user_id: string) {
|
||||
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
|
||||
return AuthorizationApi.getResourceAuthorization(
|
||||
currentWorkspaceId.value || 'default',
|
||||
workspaceId,
|
||||
user_id,
|
||||
(route.meta?.resource as string) || 'APPLICATION',
|
||||
rLoading,
|
||||
|
|
|
|||
Loading…
Reference in New Issue