使用axios。我的get方法正常,但post方法显示cors错误。并在chome-> networs-> header
中获得不同的标题响应axios.get('http://127.0.0.1:8000/api/login', {
params : {
username:username,
password:password,
}
})
.then(function(response) {
console.log(response)
})
.catch(function(error) {
console.log(error)
})
获取标题回复
Access-Control-Allow-Origin *
Access-Control-Allow-Methods POST, GET, OPTIONS, PUT, DELETE
Access-Control-Allow-Headers
Content-Type, X-Auth-Token, Origin
帖子的标题回复
Allow POST
Access-Control-Request-Method POST
Access-Control-Request-Headers content-type
帮帮我PLZ .....