此方案的解决办法还是挺简单的,正常情况下,就是打开axios的withCredentials即可
// create an axios instance const service = axios.create({ baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url withCredentials: true, // send cookies when cross-domain requests timeout: 5000, // request timeout })