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();
}

 

相关文章: