Axios.post('http://localhost:9090/teacher/save',JSON.stringify(this.teacher))
.then(res=>{
console.log('res=',res)
})
.catch(err=>{
})
Axios.post('http://localhost:9090/teacher/save',this.teacher, {headers: {"Content-Type": "application/json"}})
.then(res=>{
console.log('res=',res)
})
.catch(err=>{
})
我设置了application/json,但是从图中可以看出发送的并不是json格式,而是a=&b=这样的格式,是不是哪里配置的有问题
大家听我说,问题已经解决了,原来我的另外一个文件里面有个axios拦截器,去掉就好了,打扰各位了,不过非常谢谢你们:)