前后端分离开发过程中会出现跨域的问题
from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
# 设置跨域
CORS(app, supports_credentials=True, resources=r'/*')
@app.route('/')
def root():
return 'helllo flask'
if __name__ == '__main__':
app.run(debug=True)