vue往后台传参(不是传对象)
因为有规定必须用post提交example:vue:withdrawCount(){let formData = new FormData();formData.append("date",this.date);withdrawCount(formData).then(response => {});},js:export ...
·
因为有规定必须用post提交
example:
vue:
withdrawCount(){
let formData = new FormData();
formData.append("date",this.date);
withdrawCount(formData).then(response => {
});
},
js:
export function withdrawCount(query) {
return fetch({
url: commonUrl + '/withdrawCount',
method: 'POST',
data: query
});
}
后台:
@PostMapping(value = "withdrawCount")
public Object withdrawCount(@RequestParam(required = true) int date) {
return new UpmsResult(UpmsResultConstant.SUCCESS, dashboardService.withdrawCount(date));
}
如果传对象直接使用注解@RequestBody
更多推荐
已为社区贡献2条内容
所有评论(0)