From bf7ccee41fb74d598f1cd56c480b7684a0a6652e Mon Sep 17 00:00:00 2001 From: Kakune55 Date: Mon, 6 Nov 2023 12:23:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86api=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E8=B7=A8=E5=9F=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.py b/server.py index 775d137..59ef24e 100644 --- a/server.py +++ b/server.py @@ -1,4 +1,5 @@ import flask , requests , json , pymysql +from flask_cors import CORS # 设置请求的目标URL url = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation" # 替换为你的API端点URL @@ -94,6 +95,7 @@ def reduce_value(userkey, value): app = flask.Flask(__name__) +CORS(app,origins="*") @app.route('/api/user', methods=['POST']) def post_data():