diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml index 56671a29e7..3b4eed03da 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtVAuthModelMapper.xml @@ -19,7 +19,7 @@ model_type = #{modelType} - and ( v_auth_model.type ='spine' OR ( v_auth_model.create_by = #{createBy} AND v_auth_model.type = 'leaf')) + and FIND_IN_SET(v_auth_model.id,GET_V_AUTH_MODEL_WITH_PARENT ( (select GROUP_CONCAT(id) from v_auth_model where model_type = #{modelType} and create_by =#{createBy}) ,#{modelType})) and v_auth_model.pid = #{pid} @@ -54,7 +54,7 @@ model_type = #{modelType} - and ( v_auth_model.type ='spine' OR ( v_auth_model.create_by = #{createBy} AND v_auth_model.type = 'leaf')) + and FIND_IN_SET(v_auth_model.id,GET_V_AUTH_MODEL_WITH_PARENT ( (select GROUP_CONCAT(id) from v_auth_model where model_type = #{modelType} and create_by =#{createBy}) ,#{modelType})) ) authTemp @@ -64,7 +64,7 @@ auth.id = authCount.pid - (chartcount.children_count>0 or chart.create_by = #{createBy}) + (authCount.children_count>0 or auth.create_by = #{createBy}) diff --git a/backend/src/main/java/io/dataease/datasource/service/DatasourceService.java b/backend/src/main/java/io/dataease/datasource/service/DatasourceService.java index 1a979c8090..6966b6611c 100644 --- a/backend/src/main/java/io/dataease/datasource/service/DatasourceService.java +++ b/backend/src/main/java/io/dataease/datasource/service/DatasourceService.java @@ -51,7 +51,7 @@ public class DatasourceService { datasource.setId(UUID.randomUUID().toString()); datasource.setUpdateTime(currentTimeMillis); datasource.setCreateTime(currentTimeMillis); - datasource.setCreateBy(String.valueOf(AuthUtils.getUser().getUserId())); + datasource.setCreateBy(String.valueOf(AuthUtils.getUser().getUsername())); datasourceMapper.insertSelective(datasource); return datasource; } diff --git a/backend/src/main/resources/db/migration/V2__dataease_ddl.sql b/backend/src/main/resources/db/migration/V2__dataease_ddl.sql index 5b9a856372..1356b3fb77 100644 --- a/backend/src/main/resources/db/migration/V2__dataease_ddl.sql +++ b/backend/src/main/resources/db/migration/V2__dataease_ddl.sql @@ -36,6 +36,7 @@ CREATE TABLE IF NOT EXISTS `user_role` ( )ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; +DROP TABLE IF EXISTS `datasource`; CREATE TABLE `datasource` ( `id` varchar(50) NOT NULL DEFAULT '' COMMENT 'ID', `name` varchar(50) NOT NULL COMMENT '名称', @@ -467,4 +468,4 @@ CREATE TABLE `my_plugin` ( `bean_name` varchar(40) DEFAULT NULL COMMENT 'bean名称', `icon` varchar(255) DEFAULT NULL COMMENT '图标', PRIMARY KEY (`plugin_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/frontend/src/views/system/authority/authConfig.vue b/frontend/src/views/system/authority/authConfig.vue index 46662d7b93..1f3c814008 100644 --- a/frontend/src/views/system/authority/authConfig.vue +++ b/frontend/src/views/system/authority/authConfig.vue @@ -118,6 +118,7 @@ export default { }, created() { this.targetActiveName = this.targetInfoArray[0].authType + this.sourceActiveName = this.sourceInfoArray[0].authType }, methods: { diff --git a/frontend/src/views/system/authority/components/LazyTree.vue b/frontend/src/views/system/authority/components/LazyTree.vue index 01246ba752..d89b4dd1fb 100644 --- a/frontend/src/views/system/authority/components/LazyTree.vue +++ b/frontend/src/views/system/authority/components/LazyTree.vue @@ -181,7 +181,7 @@ export default { }) } } else { - resolve([]) + resolve(node.data.children) } }, filterNode(index) { @@ -197,7 +197,6 @@ export default { // 高亮显示 this.highlights(res.data) this.treeData = this.buildTree(res.data) - // 恢复searchStatus 状态 可以允许继续展开父级 this.$nextTick(() => (this.searchStatus = false)) }) diff --git a/frontend/src/views/system/authority/index.vue b/frontend/src/views/system/authority/index.vue index 6a8abd6018..3dffe71ed4 100644 --- a/frontend/src/views/system/authority/index.vue +++ b/frontend/src/views/system/authority/index.vue @@ -5,10 +5,10 @@ {{$t('auth.authConfig')}} - - {{$t('auth.authQuickConfig')}} - - + + + +