|
@ -443,27 +443,27 @@ def convert_decimal(obj): |
|
|
async def get_table_configs(query_db, page_object, user, role_id_list, table_name): |
|
|
async def get_table_configs(query_db, page_object, user, role_id_list, table_name): |
|
|
# 获取用户的列配置 |
|
|
# 获取用户的列配置 |
|
|
user_col_list = await MetaSecurityDao.get_api_col_list( |
|
|
user_col_list = await MetaSecurityDao.get_api_col_list( |
|
|
query_db, page_object.dbRId, table_name, '0', user[0].user_id |
|
|
query_db, page_object.dbRCode, table_name, '0', user[0].user_id |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
# 获取角色的列配置 |
|
|
# 获取角色的列配置 |
|
|
role_col_list = [] |
|
|
role_col_list = [] |
|
|
for role_id in role_id_list: |
|
|
for role_id in role_id_list: |
|
|
role_cols = await MetaSecurityDao.get_api_col_list( |
|
|
role_cols = await MetaSecurityDao.get_api_col_list( |
|
|
query_db, page_object.dbRId, table_name, '1', role_id |
|
|
query_db, page_object.dbRCode, table_name, '1', role_id |
|
|
) |
|
|
) |
|
|
role_col_list.extend(role_cols) # 将每个角色的列配置合并到列表中 |
|
|
role_col_list.extend(role_cols) # 将每个角色的列配置合并到列表中 |
|
|
|
|
|
|
|
|
# 获取用户的行配置 |
|
|
# 获取用户的行配置 |
|
|
user_row_list = await MetaSecurityDao.get_api_row_list( |
|
|
user_row_list = await MetaSecurityDao.get_api_row_list( |
|
|
query_db, page_object.dbRId, table_name, '0', user[0].user_id |
|
|
query_db, page_object.dbRCode, table_name, '0', user[0].user_id |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
# 获取角色的行配置 |
|
|
# 获取角色的行配置 |
|
|
role_row_list = [] |
|
|
role_row_list = [] |
|
|
for role_id in role_id_list: |
|
|
for role_id in role_id_list: |
|
|
role_rows = await MetaSecurityDao.get_api_row_list( |
|
|
role_rows = await MetaSecurityDao.get_api_row_list( |
|
|
query_db, page_object.dbRId, table_name, '1', role_id |
|
|
query_db, page_object.dbRCode, table_name, '1', role_id |
|
|
) |
|
|
) |
|
|
role_row_list.extend(role_rows) # 将每个角色的行配置合并到列表中 |
|
|
role_row_list.extend(role_rows) # 将每个角色的行配置合并到列表中 |
|
|
isHave = any([ |
|
|
isHave = any([ |
|
@ -637,7 +637,7 @@ async def get_data_source_tree(request: Request, current_user: MetaSecurityApiMo |
|
|
total_list = data["data"]["totalList"] |
|
|
total_list = data["data"]["totalList"] |
|
|
# 解析 connectionParams 字符串为字典 |
|
|
# 解析 connectionParams 字符串为字典 |
|
|
for item in total_list: |
|
|
for item in total_list: |
|
|
if item["name"]==current_user.dbRId: |
|
|
if item["name"]==current_user.dbRCode: |
|
|
item["connectionParams"] = json.loads(item["connectionParams"]) |
|
|
item["connectionParams"] = json.loads(item["connectionParams"]) |
|
|
return item |
|
|
return item |
|
|
raise Exception(f'根据数据源ID:{current_user.dbRCode}获取数据源信息失败,状态: {response.reason}') |
|
|
raise Exception(f'根据数据源ID:{current_user.dbRCode}获取数据源信息失败,状态: {response.reason}') |
|
|