From 57920bf771238145a1fa92827a69e3dff70bd03f Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Thu, 10 Oct 2024 16:59:45 +0800 Subject: [PATCH] fix: user lack permission to view the type tree --- src/components/Apps/AssetTreeTable/index.vue | 8 ++++++-- src/views/ops/Job/JobUpdateCreate.vue | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Apps/AssetTreeTable/index.vue b/src/components/Apps/AssetTreeTable/index.vue index 5164802a5..56c316a9a 100644 --- a/src/components/Apps/AssetTreeTable/index.vue +++ b/src/components/Apps/AssetTreeTable/index.vue @@ -31,6 +31,10 @@ export default { type: String, default: '/api/v1/assets/assets/' }, + typeUrl: { + type: String, + default: '/api/v1/assets/nodes/category/tree/' + }, nodeUrl: { type: String, default: '/api/v1/assets/nodes/' @@ -101,9 +105,9 @@ export default { showAssets: false, showSearch: false, customTreeHeaderName: this.$t('assets.BuiltinTree'), - url: '/api/v1/assets/nodes/category/tree/', + url: this.typeUrl, nodeUrl: this.treeSetting?.nodeUrl || this.nodeUrl, - treeUrl: `/api/v1/assets/nodes/category/tree/?assets=${showAssets ? '1' : '0'}&count_resource=${this.treeSetting.countResource || 'asset'}`, + treeUrl: `${this.typeUrl}?assets=${showAssets ? '1' : '0'}&count_resource=${this.treeSetting.countResource || 'asset'}`, callback: { onSelected: (event, treeNode) => this.getAssetsUrl(treeNode) } diff --git a/src/views/ops/Job/JobUpdateCreate.vue b/src/views/ops/Job/JobUpdateCreate.vue index dce3d32a8..941243067 100644 --- a/src/views/ops/Job/JobUpdateCreate.vue +++ b/src/views/ops/Job/JobUpdateCreate.vue @@ -98,6 +98,7 @@ export default { el: { baseUrl: '/api/v1/perms/users/self/assets/', baseNodeUrl: '/api/v1/perms/users/self/nodes/', + typeUrl: '/api/v1/perms/users/self/nodes/children-with-assets/category/tree', value: [] } },