Explorar o código

跨域不带cookie

lihao %!s(int64=4) %!d(string=hai) anos
pai
achega
a0a062b7ec
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      src/main.js

+ 4 - 2
src/main.js

@@ -25,10 +25,12 @@ Vue.use(Element, {
 Vue.prototype.$api = process.env.NODE_ENV == 'development' ? "/api" : "http://localhost:9000";
 Vue.http.options.emulateJSON = true;
 Vue.prototype.$md5 = md5;
-Vue.http.options.xhr = { withCredentials: true,}
+Vue.http.options.xhr = { 
+  // withCredentials: true,
+}
 Vue.http.interceptors.push(function (request, next) {//拦截器
   // 跨域携带cookie
-  request.credentials = true;
+  //request.credentials = true;
   next()
 })
 new Vue({