diff options
| author | handingkang <[email protected]> | 2024-04-12 16:55:31 +0800 |
|---|---|---|
| committer | handingkang <[email protected]> | 2024-04-12 16:55:31 +0800 |
| commit | 9030bae9cafec72f36b1a770663a4b3d3057b0aa (patch) | |
| tree | b7eaf276bf54841a082e1183018ed4c7e0295b02 | |
| parent | 914a569750942e61af3bebbbf99e834d35a66200 (diff) | |
新增跨域支持
| -rw-r--r-- | server/app.py | 3 | ||||
| -rw-r--r-- | server/apps/target.py | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/server/app.py b/server/app.py index 4f02203..b1ed6a5 100644 --- a/server/app.py +++ b/server/app.py @@ -1,4 +1,5 @@ from apiflask import APIFlask +from flask_cors import CORS import settings from apps.agentcomm import bp as agentbp @@ -9,6 +10,8 @@ from apps.task import bp as taskbp # 注册蓝图 app = APIFlask(__name__, template_folder='./static/templates') +# 跨域支持 +CORS(app) # 目标状态获取接口 app.register_blueprint(targetbp) # 代理接口 diff --git a/server/apps/target.py b/server/apps/target.py index 6ea43d1..98a5294 100644 --- a/server/apps/target.py +++ b/server/apps/target.py @@ -213,7 +213,7 @@ def record(query_data): @bp.get("/") [email protected]("目标信息获取接口", "返回目标信息") [email protected]("目标信息获取接口", "返回目标信息,已测试") @bp.input({ "per_page": Integer(load_default=10), "page": Integer(load_default=1), |
