Access to XMLHttpRequest at ‘http://127.0.0.1:5000/gpu_info’ from origin ‘http://localhost:8080’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
pip install flask_cors
加上CORS
from flask_cors import *
app = Flask(__name__)
CORS(app,resources=r'/*')