1.注意点
//JSON.parse() => 将数据转换为 JavaScript 对象
//JSON.stringigy() =>将 JavaScript 数组转换为 JSON 字符串
1.JSON.parse(JSON.stringify(this.user))
//规定传递的参数格式为json
2.'Content-Type':'application/json'
axios({
url: "http://localhost/user",
data: JSON.parse(JSON.stringify(this.user)),
method:"POST",
header:{
'Content-Type':'application/json'
}
}).then(res=>{
console.log(res.data)
})