- 因为
Spring MVC对数组类型有特殊的处理逻辑。它会自动尝试将同名的查询参数或逗号分隔的字符串转换为数组 - 错误
- http://localhost:5173/api/cus_dev_plan/delete?ids[]=7&ids[]=8
请求方法:
GET
状态代码:
400 Bad Request 正确
http://localhost:5173/api/cus_dev_plan/delete?ids=7,8 传集合后端需要在前面加上@RequestParams("ids")
Spring MVC 对数组类型有特殊的处理逻辑。它会自动尝试将同名的查询参数或逗号分隔的字符串转换为数组请求方法:
GET
状态代码:
400 Bad Request 正确
http://localhost:5173/api/cus_dev_plan/delete?ids=7,8 传集合后端需要在前面加上@RequestParams("ids")