修复了api调用的跨域问题

This commit is contained in:
Kakune55 2023-11-06 12:23:58 +08:00
parent 2eef6db5be
commit bf7ccee41f

View File

@ -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():