把传递的"application/json"参数改为"application/x-www-form-urlencoded", 具体参考代码:
method() {
var t = this;
axios({
method: "post",
url: "/login",
baseURL: "http://192.168.0.153:8088/",
withCredentials:true,
params: {
username: "zhangsan",
passWd: "123"
},
responsetype:'json',
headers:{'Content-Type': 'application/x-www-form-urlencoded'}
}).then(function(response){
//console.log(response);
}).catch(function(error){
console.log(error);
});
},
注 : 有不足的地方, 欢迎各位朋友评论留言!!!