|
|
@ -637,13 +637,13 @@ async def get_data_source_tree(request: Request, current_user: MetaSecurityApiMo |
|
|
|
total_list = data["data"]["totalList"] |
|
|
|
# 解析 connectionParams 字符串为字典 |
|
|
|
for item in total_list: |
|
|
|
if item["id"]==current_user.dbRId: |
|
|
|
if item["name"]==current_user.dbRId: |
|
|
|
item["connectionParams"] = json.loads(item["connectionParams"]) |
|
|
|
return item |
|
|
|
raise Exception(f'根据数据源ID:{current_user.dbRId}获取数据源信息失败,状态: {response.reason}') |
|
|
|
raise Exception(f'根据数据源ID:{current_user.dbRCode}获取数据源信息失败,状态: {response.reason}') |
|
|
|
|
|
|
|
else: |
|
|
|
raise Exception(f'根据数据源ID:{current_user.dbRId}获取数据源信息失败,状态: {response.reason}') |
|
|
|
raise Exception(f'根据数据源ID:{current_user.dbRCode}获取数据源信息失败,状态: {response.reason}') |
|
|
|
async def test_connection(db_content): |
|
|
|
try: |
|
|
|
# 尝试执行一个简单的查询来测试连接 |
|
|
|