前后端分离经常会遇到跨域的情况
ajax访问会出现:
Access to XMLHttpRequest at ' ' from origin 'http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
chrome
创建 chrome 快捷方式
然后在最后加上 -disable-web-security -user-data-dir
关闭chrome 重新打开 chrome 出现这个就代表成功了。
还不赶快去试试