axios跨域携带cookie需要配置
- axios跨域发送请求的时候默认不会带上cookie的
axios.defaults.withCredentials
- withCredentials的情况下,后端要设置Access-Control-Allow-Origin为你的源地址,例如http://localhost:8080,不能是*,而且还要设置header('Access-Control-Allow-Credentials: true');
- 留作个人笔记
axios.defaults.withCredentials