参考:
http://stackoverflow.com/questions/25860304/how-do-i-set-response-headers-in-flask
也就是说,设置下响应头就可以了,如:
1 … 2 3 resp = Response(js,status = 200 ,mimetype = ' application/json ' ) 4 resp.headers[ ' Access-Control-Allow-Origin ' ] = ' * ' 5 6 return resp 7
记录下,免得忘了