header('Access-Control-Allow-Origin:http://127.0.0.1:8080'); // 这里必须要对应绝对的请求地址,不可为 *
header('Access-Control-Allow-Credentials:true'); //表示是否允许发送Cookie
让ajax携带cookie
axios.defaults.withCredentials = true;
价值参考:《跨域资源共享 CORS 详解》—— 阮一峰
http://www.ruanyifeng.com/blog/2016/04/cors.html