Apifox与注解

使用@RequestParam时,若不是表单上传,可以用FormData进行Ajax请求
例子:
Controller层:
@PostMapping("/deleteProduct")
public CommonResp deleteProduct(@RequestParam("id") Integer id){
return productService.deleteProduct(id) ? CommonResp.success("删除成功"):CommonResp.failed("删除失败");
}
js:
export const goodsDelete=(data)=>{
var form=new FormData()
form.append("id",data)
return post({
url:'/deleteProduct',
data:form
})
}

浙公网安备 33010602011771号