From 6831b250bee0216b277e5ce8e990a47c0bacee66 Mon Sep 17 00:00:00 2001
From: Cxx0822 <1556464090@qq.com>
Date: Mon, 27 Jul 2026 23:01:49 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E8=B7=A8=E8=B6=8A?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/study-agent-service.iml | 3 +-
.idea/workspace.xml | 68 +++++++++++++++++------------------
main.py | 8 +++++
3 files changed, 42 insertions(+), 37 deletions(-)
diff --git a/.idea/study-agent-service.iml b/.idea/study-agent-service.iml
index 694ec20..c503449 100644
--- a/.idea/study-agent-service.iml
+++ b/.idea/study-agent-service.iml
@@ -3,8 +3,9 @@
+
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 3f2507e..3945a36 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -5,21 +5,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -38,29 +26,32 @@
-
+ {
+ "associatedIndex": 4
+}
-
- {
+ "keyToString": {
+ "FastAPI.study-agent-service.executor": "Run",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
+ "RunOnceActivity.git.unshallow": "true",
+ "RunOnceActivity.typescript.service.memoryLimit.init": "true",
+ "git-widget-placeholder": "master",
+ "last_opened_file_path": "D:/Projects/GithubProjects/study-agent-service",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "preferences.lookFeel",
+ "vue.rearranger.settings.migration": "true"
}
-}]]>
+}
@@ -75,12 +66,14 @@
-
+
+
+
@@ -88,8 +81,8 @@
-
-
+
+
@@ -102,6 +95,9 @@
1785141112222
+
+
+
@@ -109,6 +105,6 @@
-
+
\ No newline at end of file
diff --git a/main.py b/main.py
index ed31b4c..f81e90f 100644
--- a/main.py
+++ b/main.py
@@ -1,4 +1,5 @@
from fastapi import FastAPI, UploadFile, File
+from starlette.middleware.cors import CORSMiddleware
from starlette.responses import StreamingResponse
from models.agent import QueryRequest
@@ -8,6 +9,13 @@ from ocr import ocr_from_url
app = FastAPI(title="AI Study Service")
+app.add_middleware(
+ CORSMiddleware,
+ allow_origins=["*"],
+ allow_methods=["*"],
+ allow_headers=["*"],
+)
+
@app.post("/upload")
def upload(file: UploadFile = File(...)):