解决办法 http tor 获取 发送请求 option ons 失败
第一次使用vue进行开发,在获取图片验证码与服务器进行比对时,提示验证码错误,最后发现请求时未携带cookie,导致SESSIONID改变致使校验失败.
解决办法
Vue.http.options.emulateJSON = true;Vue.http.options.xhr = { withCredentials: true }
//在拦截其中添加此属性即可Vue.http.interceptors.push((request, next) => {request.credentials = truenext()})
使用vue时,发送请求不带cookie
来源: http://www.bubuko.com/infodetail-2019203.html