vue-resource 设置请求的参数以formData形式以及设置请求的过滤器

在main.js中添加下面的设置:

Vue.http.options.emulateJSON = true;
Vue.http.options.headers = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'};

Vue.http.interceptors.push((request, next) => {
next((response) => {}

});

注意:一定要加在的Vue实例之前

原文地址:https://www.cnblogs.com/xiaofenguo/p/7204053.html