소스 검색

跨域不带cookie

lihao 4 년 전
부모
커밋
a0a062b7ec
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  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({