是否有跨域問題
Access to XMLHttpRequest at 'http://localhost:3000/xxx' from origin 'http://localhost:8081' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 控制臺顯示這個錯誤,不能打印出res,但是response返回結果里顯示有數據。 這個怎么解決呢
2019-07-29
是的,跨域了,要么你讓后端設置cors,要么你讓后端配合你做jsonp,或者你自己搭建Nginx代理服務器,或者你在webpack中使用proxy,或者你修改winodw的domain,只能這樣子了