From b16bfdfa03a76b2c6d5226bddfa77885f6830515 Mon Sep 17 00:00:00 2001 From: EvanSung Date: Thu, 17 Aug 2023 18:40:45 +0800 Subject: [PATCH 1/3] fix(acl): g user issue --- cmdb-api/api/lib/perm/acl/audit.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmdb-api/api/lib/perm/acl/audit.py b/cmdb-api/api/lib/perm/acl/audit.py index 921d619..f72c3ca 100644 --- a/cmdb-api/api/lib/perm/acl/audit.py +++ b/cmdb-api/api/lib/perm/acl/audit.py @@ -49,9 +49,7 @@ class AuditCRUD(object): @staticmethod def get_current_operate_uid(uid=None): - - user_id = uid or (hasattr(g, 'user') and getattr(current_user, 'uid', None)) \ - or getattr(current_user, 'user_id', None) + user_id = uid or getattr(current_user, 'uid', None) if has_request_context() and request.headers.get('X-User-Id'): _user_id = request.headers['X-User-Id'] From 0ebd52f3fdae6953a8e7ab01e10a4184f16694af Mon Sep 17 00:00:00 2001 From: pycook Date: Sat, 19 Aug 2023 11:04:06 +0800 Subject: [PATCH 2/3] lint --- .../operation_history/modules/typeTable.vue | 2 +- .../modules/cmdb/views/tree_views/index.vue | 18 +++++++++++------- .../setting/companyStructure/EmployeeModal.vue | 6 +++--- cmdb-ui/src/views/user/Login.vue | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/typeTable.vue b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/typeTable.vue index be1b32b..6bc8e13 100644 --- a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/typeTable.vue +++ b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/typeTable.vue @@ -60,7 +60,7 @@ diff --git a/cmdb-ui/src/modules/cmdb/views/tree_views/index.vue b/cmdb-ui/src/modules/cmdb/views/tree_views/index.vue index c65d942..e0b4ad5 100644 --- a/cmdb-ui/src/modules/cmdb/views/tree_views/index.vue +++ b/cmdb-ui/src/modules/cmdb/views/tree_views/index.vue @@ -14,12 +14,16 @@ } " class="cmdb-views-header-metadata" - > + > 属性说明 - 新建新建 {{ value }}{{ value }} diff --git a/cmdb-ui/src/views/user/Login.vue b/cmdb-ui/src/views/user/Login.vue index d64553e..f3824b4 100644 --- a/cmdb-ui/src/views/user/Login.vue +++ b/cmdb-ui/src/views/user/Login.vue @@ -117,7 +117,7 @@ export default { const loginParams = { ...values } delete loginParams.username loginParams[!state.loginType ? 'email' : 'username'] = values.username - loginParams.password = appConfig.useEncryption?md5(values.password):values.password + loginParams.password = appConfig.useEncryption ? md5(values.password) : values.password Login(loginParams) .then((res) => this.loginSuccess(res)) .finally(() => { From 4abe4d7e8f1639841999b5727b5b72459a2ce7b5 Mon Sep 17 00:00:00 2001 From: pycook Date: Sat, 19 Aug 2023 12:43:55 +0800 Subject: [PATCH 3/3] version: 2.3.1 --- .../src/modules/acl/views/module/roleHistoryTable.vue | 2 +- .../src/modules/acl/views/module/triggerHistoryTable.vue | 2 +- .../operation_history/modules/triggerHistoryTable.vue | 2 +- cmdb-ui/src/modules/cmdb/views/ci/index.vue | 6 +++--- cmdb-ui/src/modules/cmdb/views/discovery/index.vue | 2 +- cmdb-ui/src/modules/cmdb/views/model_relation/index.vue | 2 +- cmdb-ui/src/modules/cmdb/views/relation_views/index.vue | 2 +- cmdb-ui/src/views/setting/components/employeeTable.vue | 3 +-- docker-compose.yml | 9 ++++----- 9 files changed, 14 insertions(+), 16 deletions(-) diff --git a/cmdb-ui/src/modules/acl/views/module/roleHistoryTable.vue b/cmdb-ui/src/modules/acl/views/module/roleHistoryTable.vue index b11d559..10e9468 100644 --- a/cmdb-ui/src/modules/acl/views/module/roleHistoryTable.vue +++ b/cmdb-ui/src/modules/acl/views/module/roleHistoryTable.vue @@ -287,7 +287,7 @@ export default { item.description += str } else { const str = ` 【 ${key} : 由 ${oldVal} 改为 ${newVal} 】 ` - item.description += ` 【 ${key} : 由 ${oldVal} 改为 ${newVal} 】 ` + item.description += str } } } diff --git a/cmdb-ui/src/modules/acl/views/module/triggerHistoryTable.vue b/cmdb-ui/src/modules/acl/views/module/triggerHistoryTable.vue index 7018efc..0c2bbcf 100644 --- a/cmdb-ui/src/modules/acl/views/module/triggerHistoryTable.vue +++ b/cmdb-ui/src/modules/acl/views/module/triggerHistoryTable.vue @@ -238,7 +238,7 @@ export default { item.changeDescription += str } else { const str = ` 【 ${key} : 由 ${oldVal} 改为 ${newVal} 】 ` - item.changeDescription += ` 【 ${key} : 由 ${oldVal} 改为 ${newVal} 】 ` + item.changeDescription += str } } } diff --git a/cmdb-ui/src/modules/acl/views/operation_history/modules/triggerHistoryTable.vue b/cmdb-ui/src/modules/acl/views/operation_history/modules/triggerHistoryTable.vue index 75e5ed8..3ff9ac9 100644 --- a/cmdb-ui/src/modules/acl/views/operation_history/modules/triggerHistoryTable.vue +++ b/cmdb-ui/src/modules/acl/views/operation_history/modules/triggerHistoryTable.vue @@ -286,7 +286,7 @@ export default { item.changeDescription += str } else { const str = ` 【 ${key} : 由 ${oldVal} 改为 ${newVal} 】 ` - item.changeDescription += ` 【 ${key} : 由 ${oldVal} 改为 ${newVal} 】 ` + item.changeDescription += str } } } diff --git a/cmdb-ui/src/modules/cmdb/views/ci/index.vue b/cmdb-ui/src/modules/cmdb/views/ci/index.vue index 1399b80..cfa03ae 100644 --- a/cmdb-ui/src/modules/cmdb/views/ci/index.vue +++ b/cmdb-ui/src/modules/cmdb/views/ci/index.vue @@ -550,7 +550,7 @@ export default { .then(() => { successNum += 1 }) - .catch((err) => { + .catch(() => { errorNum += 1 }) .finally(() => { @@ -584,7 +584,7 @@ export default { .then(() => { successNum += 1 }) - .catch((err) => { + .catch(() => { errorNum += 1 }) .finally(() => { @@ -685,7 +685,7 @@ export default { }, onEnd: (params) => { // 由于开启了虚拟滚动,newIndex和oldIndex是虚拟的 - const { newIndex, oldIndex, from, to } = params + const { newIndex, oldIndex } = params // 从tableDragClassName拿到colid const fromColid = this.tableDragClassName[oldIndex] const toColid = this.tableDragClassName[newIndex] diff --git a/cmdb-ui/src/modules/cmdb/views/discovery/index.vue b/cmdb-ui/src/modules/cmdb/views/discovery/index.vue index a11e284..e2442fd 100644 --- a/cmdb-ui/src/modules/cmdb/views/discovery/index.vue +++ b/cmdb-ui/src/modules/cmdb/views/discovery/index.vue @@ -31,7 +31,7 @@