We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
前端解决跨域问题的8种方案
前端
// 全局配置 axios.defaults.withCredentials = true // 请求中设置 https://github.com/axios/axios#user-content-request-config { url: '/user', withCredentials: true, // default false method: 'get', // default baseURL: 'https://some-domain.com/api/', }
后端
// 设置 header "Access-Control-Allow-Credentials", "true" "Access-Control-Allow-Origin", "https://api.jogiter.com"
因为 cookie 是针对域名的,所以需要指明具体域名,如果有多个域名可以用 ‘,’ 分隔
The text was updated successfully, but these errors were encountered:
No branches or pull requests
前端解决跨域问题的8种方案
前端
后端
The text was updated successfully, but these errors were encountered: