axios默认是发送请求的时候不会带上cookie的,需要通过设置withCredentials: true来解决。
import axios from 'axios'; // 引入axios
axios.defaults.withCredentials = true; // 允许携带cookie
axios默认是发送请求的时候不会带上cookie的,需要通过设置withCredentials: true来解决。
import axios from 'axios'; // 引入axios
axios.defaults.withCredentials = true; // 允许携带cookie