diff --git a/app/core/constructor/python_constructor.py b/app/core/constructor/python_constructor.py index 7a9daccf..c35693d2 100644 --- a/app/core/constructor/python_constructor.py +++ b/app/core/constructor/python_constructor.py @@ -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") diff --git a/app/crud/config/DbConfigDao.py b/app/crud/config/DbConfigDao.py index c8d57f1d..23b24350 100644 --- a/app/crud/config/DbConfigDao.py +++ b/app/crud/config/DbConfigDao.py @@ -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}")