给后端传递List参数
1、把数组用JSON.stringify方法变为json字符串
var requestBody = JSON.stringify(window.roleIdArray);
2、后台接受代码
@ResponseBody @RequestMapping("/role/remove/by/role/id/array.json") public ResultEntity<String > deleteRole(@RequestBody List<Integer> roleIdList) { roleService.deleteRoles(roleIdList); return ResultEntity.successWithoutData(); }