vue项目中axios请求默认是不携带cookie值,
如果需要携带cookie需要加入axios.defaults.withCredentials=true;
import axios from 'axios'
axios.defaults.withCredentials=true;//携带cookie
Vue.prototype.$axios = axios;
不然的话退出登录总是返回未登录。
vue项目中axios请求默认是不携带cookie值,
如果需要携带cookie需要加入axios.defaults.withCredentials=true;
import axios from 'axios'
axios.defaults.withCredentials=true;//携带cookie
Vue.prototype.$axios = axios;
不然的话退出登录总是返回未登录。