是否有跨域問(wèn)題
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. 控制臺(tái)顯示這個(gè)錯(cuò)誤,不能打印出res,但是response返回結(jié)果里顯示有數(shù)據(jù)。 這個(gè)怎么解決呢
2019-07-29
是的,跨域了,要么你讓后端設(shè)置cors,要么你讓后端配合你做jsonp,或者你自己搭建Nginx代理服務(wù)器,或者你在webpack中使用proxy,或者你修改winodw的domain,只能這樣子了