Skip to content

Commit

Permalink
fix: sql and python doesn't get response error
Browse files Browse the repository at this point in the history
  • Loading branch information
wuranxu committed Jan 31, 2024
1 parent ecf915b commit 7f06ed2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/core/constructor/python_constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def run(executor, env, index, path, params, req_params, constructor: Constructor
executor.append(
f"当前{ConstructorAbstract.get_name(constructor)}未返回任何值")
return
if not isinstance(py_data, str):
py_data = json.dumps(py_data, ensure_ascii=False)
# if not isinstance(py_data, str):
# py_data = json.dumps(py_data, ensure_ascii=False)
params[constructor.value] = py_data
executor.append(
f"当前{ConstructorAbstract.get_name(constructor)}返回变量: {constructor.value}\n返回值:\n {py_data}\n")
Expand Down
3 changes: 2 additions & 1 deletion app/crud/config/DbConfigDao.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ async def execute_sql(env: int, name: str, sql: str):
query.database)
result, _ = await DbConfigDao.execute(data, sql)
_, result = PityResponse.parse_sql_result(result)
return json.dumps(result, cls=JsonEncoder, ensure_ascii=False)
return result
# return json.dumps(result, cls=JsonEncoder, ensure_ascii=False)
except Exception as e:
DbConfigDao.log.error(f"查询数据库配置失败, error: {e}")
raise Exception(f"执行SQL失败: {e}")
Expand Down

0 comments on commit 7f06ed2

Please sign in to comment.