Skip to content

Commit

Permalink
适配ninja
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanyutin753 authored Feb 14, 2024
1 parent 37b0dd7 commit 0d0ae4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2261,7 +2261,7 @@ def chat_completions():
if REFRESH_TOACCESS_ENABLEOAI:
api_key = oaiGetAccessToken(api_key)
else:
api_key = ninjaGetAccessToken(REFRESH_TOACCESS_XYHELPER_REFRESHTOACCESS_URL, api_key)
api_key = ninjaGetAccessToken(REFRESH_TOACCESS_NINJA_REFRESHTOACCESS_URL, api_key)
if not api_key.startswith("eyJhb"):
return jsonify({"error": "refresh_token is wrong or refresh_token url is wrong!"}), 401
add_to_dict(refresh_token, api_key)
Expand Down Expand Up @@ -2426,7 +2426,7 @@ def images_generations():
refresh_token = api_key
api_key = oaiGetAccessToken(api_key)
else:
api_key = ninjaGetAccessToken(REFRESH_TOACCESS_XYHELPER_REFRESHTOACCESS_URL, api_key)
api_key = ninjaGetAccessToken(REFRESH_TOACCESS_NINJA_REFRESHTOACCESS_URL, api_key)
if not api_key.startswith("eyJhb"):
return jsonify({"error": "refresh_token is wrong or refresh_token url is wrong!"}), 401
add_to_dict(refresh_token, api_key)
Expand Down Expand Up @@ -2606,7 +2606,7 @@ def updateRefresh_dict():
refresh_token = key
access_token = oaiGetAccessToken(key)
else:
access_token = ninjaGetAccessToken(REFRESH_TOACCESS_XYHELPER_REFRESHTOACCESS_URL, key)
access_token = ninjaGetAccessToken(REFRESH_TOACCESS_NINJA_REFRESHTOACCESS_URL, key)
if not access_token.startswith("eyJhb"):
logger.debug("refresh_token is wrong or refresh_token url is wrong!")
error_num += 1
Expand Down

0 comments on commit 0d0ae4a

Please sign in to comment.