Flask设置跨域的方法
1.首先下载flask_cors模块
bash
pip install flask_cors
2.设置跨域
python
from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
CORS(app, resources=r'/*')
if __name__ == '__main__':
app.run()