From b2e47e75a231baf5a7beca476256ab3d94e76c46 Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期二, 01 四月 2025 10:08:15 +0800 Subject: [PATCH] code加密 --- app/api/agent.py | 2 +- app/api/files.py | 2 ++ app/api/auth.py | 1 + app/service/auth.py | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/api/agent.py b/app/api/agent.py index 1d275bc..e3a9e31 100644 --- a/app/api/agent.py +++ b/app/api/agent.py @@ -18,7 +18,7 @@ from app.service.dialog import get_session_history from app.service.ragflow import RagflowService from app.service.service_token import get_ragflow_token, get_bisheng_token -from app.task.fetch_agent import initialize_agents +# from app.task.fetch_agent import initialize_agents router = APIRouter() diff --git a/app/api/auth.py b/app/api/auth.py index 5f6d95b..a8d381d 100644 --- a/app/api/auth.py +++ b/app/api/auth.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import json from fastapi import APIRouter, Depends diff --git a/app/api/files.py b/app/api/files.py index 7107025..c6c05c5 100644 --- a/app/api/files.py +++ b/app/api/files.py @@ -138,6 +138,8 @@ return Response(code=400, msg=str(e)) try: file_upload = await dify_service.upload(token, f.filename, file_content, current_user.id) + if not file_upload: + raise HTTPException(status_code=500, detail="涓婁紶鏂囦欢鍑洪敊") try: tokens = await read_file(file_content, f.filename, f.content_type) file_upload["tokens"] = tokens diff --git a/app/service/auth.py b/app/service/auth.py index ffdece9..3c726fa 100644 --- a/app/service/auth.py +++ b/app/service/auth.py @@ -1,4 +1,4 @@ -锘縤mport os.path +import os.path import re import uuid import base64 -- Gitblit v1.8.0