Axios向后台提交 集合形式的参数
后端用@requestBody方式接收
//接口定义
public PageTableResponse list(
@RequestBody PageTableRequest request)
//参数类定义
public class PageTableRequest implements Serializable {
private Integer offset;
private Integer limit;
private Object pms;
private Map<String, Object> params;
}
其中,params是集合类型的参数,要使用@RequestBody注解接收
前端传参形式:
export async function getTalentList(formData) {
return axios({
method: 'post',
url: '/talent/list',
//headers: {'Content-Type':'application/json;charset=UTF-8'},
data:
{
limit: 15,
offset: 0,
params: {
paltformId: 1
}
}
})
}