Commit 9af6ae57 authored by Yaowentong's avatar Yaowentong

修复三方参数

parent 61512595
...@@ -223,13 +223,14 @@ def get_auth_info_by_token(auth_token: str): ...@@ -223,13 +223,14 @@ def get_auth_info_by_token(auth_token: str):
if not auth_token: if not auth_token:
return None return None
sql = f""" sql = """
select channel, authorization, allow_platforms, status, daily_limit, total_limit,platform_costs,thinking_costs select channel, authorization, allow_platforms, status, daily_limit, total_limit, platform_costs, thinking_costs
from geo_third_token from geo_third_token
where authorization = '{auth_token}' where authorization = %s
limit 1 limit 1
""" """
data = bh_utils.query_data(sql)
data = bh_utils.query_data(sql, (auth_token,))
if not data: if not data:
return None return None
return data[0] return data[0]
...@@ -362,12 +363,14 @@ def create_auth(): ...@@ -362,12 +363,14 @@ def create_auth():
return err(400, "total_limit must be >= daily_limit") return err(400, "total_limit must be >= daily_limit")
exists = bh_utils.query_data( exists = bh_utils.query_data(
f""" """
select channel, authorization, daily_limit, total_limit, allow_platforms,platform_costs,thinking_costs select channel, authorization, daily_limit, total_limit, allow_platforms, platform_costs, thinking_costs
from geo_third_token from geo_third_token
where channel = '{channel}' and status = 1 where channel = %s
and status = 1
limit 1 limit 1
""" """,
(channel,)
) )
if exists: if exists:
_, daily_used_count, daily_remain_count = get_today_limit_info( _, daily_used_count, daily_remain_count = get_today_limit_info(
...@@ -599,7 +602,14 @@ def mt_get_result(): ...@@ -599,7 +602,14 @@ def mt_get_result():
try: try:
data = bh_utils.query_data( data = bh_utils.query_data(
f"select * from geo_third_task_data where reqId = '{req_id}' and channel = '{channel}' limit 1" """
select *
from geo_third_task_data
where reqId = %s
and channel = %s
limit 1
""",
(req_id, channel)
) )
except Exception as e: except Exception as e:
return jsonify({ return jsonify({
...@@ -782,3 +792,4 @@ def mt_get_usage(): ...@@ -782,3 +792,4 @@ def mt_get_usage():
# "history_used_list": history_userd_list # "history_used_list": history_userd_list
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment