Home > front end >  Different tp5 vue asynchronous cross-domain sessionid
Different tp5 vue asynchronous cross-domain sessionid

Time:09-19

I've put the header information of tp5 and vue axios cookie information is opened to carry, but through axios take a value when the asynchronous call session or not, your bosses, give advice or comments please

CodePudding user response:

 
$response - & gt; The header ([
'Access - Control - Allow - Origin=& gt; 'http://localhost:8080',
'Access - Control - Allow - the Methods'=& gt; 'GET, POST, PATCH, PUT, DELETE',
'Access - Control - Allow - Headers'=& gt; 'Authorization, the content-type, If - Match, the if-modified-since, If - None - Match, If - Unmodified - Since, X - Requested - With, token, uid, Cookie, Authorization',
'Access - Control - Allow - Credentials'=& gt; The 'true'
]);




The above Credentials

Axios also need to open in the
 
Axios. Create ({
BaseURL: "http://localhost/",//url=base url + request url
WithCredentials: true,//the send cookies when cross - domain requests
Timeout: 5000//request timeout
})
  • Related