我的问题是发送Json 数据中有含有 Date 类型数据后台没加注解,加了就对
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
前端axios 发送格式
这里是封装的ajax 请求,记得全局引用一下
export const postJsonRequest = (url,params) => {
return axios({
method: 'post',
url: `${base}${url}`,
data: params,
dataType: "json",
});
}
methods 中
addEmp(){
// this.dialogVisible = false;
this.postJsonRequest("/educational-experience/add",this.education).then(resp=>{
if (resp && resp.status == 200) {
console.log(resp);
}
})
},
在main.js中引入
Vue.prototype.postJsonRequest = postJsonRequest;