vue-resource http攔截器interceptors:vue
Vue.http.interceptors.push(function(request, next) {...}cookie
V-cookie:異步
request.getHeader("x-requested-with");爲null,則爲傳統同步請求,爲 XMLHttpRequest,則爲 Ajax 異步請求。vue-resource
request.headers.set('X-Requested-With', 'XMLHttpRequest');get