5,006
社区成员
发帖
与我相关
我的任务
分享
$response->header([
'Access-Control-Allow-Origin' => 'http://localhost:8080',
'Access-Control-Allow-Methods' => 'GET, POST, PATCH, PUT, DELETE',
'Access-Control-Allow-Headers' => 'Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With,token,uid,Cookie,authorization',
'Access-Control-Allow-Credentials' => 'true'
]);
如上 Credentials
axios中也需要开启
axios.create({
baseURL: "http://localhost/", // url = base url + request url
withCredentials: true, // send cookies when cross-domain requests
timeout: 5000 // request timeout
})