VUE-자원 :VUE-자원 : 액세스 제어 - 허용 - 원산지 오류
XMLHttpRequest cannot load http://finance.app/jwt/access_token. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
:
내 API를 제대로 CORS의 laravel로 구성되어
Vue.http.post(API_URL + '/jwt/access_token', credentials, {
headers: {
'Access-Control-Allow-Origin': true
}
}).then(response => {
console.log(response.data)
}, err => reject(err))
..
내가 그 오류요청 헤더 :
OPTIONS /jwt/access_token HTTP/1.1
Host: finance.app
Connection: keep-alive
Access-Control-Request-Method: POST
Origin: http://localhost:8080
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36
Access-Control-Request-Headers: access-control-allow-origin, content-type
Accept: */*
Referer: http://localhost:8080/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
내가 잘못 가고있어? :(
감사
그럼, 응답 헤더에 대해? – gurghet
문제가 해결되었습니다. vue-resource에는 설정이 없지만 laravel의 작은 미들웨어 구성 오류가 있습니다. 감사합니다. . – Giovanne