vue+vue-resource+vue-cookie隨筆

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

相關文章
相關標籤/搜索