项目场景:

由前台向后台传递List参数

解决方案:

前台
export function deleteAllResolvrd(times) {
  console.log(times)
  return request({
    url: '/resoledMassage/deleteAll',
    method: 'put',
    data: times

  })
后台接收
@PutMapping("/deleteAll")
    public AjaxResult deleteAll(@RequestBody List<String> times) {
        int i=0;
        for (String  time:times) {
            sysResolvedMessageService.deleteSysResolvedMessage(time);
            i++;
        }
        return toAjax(i);
    }

PS:这个问题很简单,可是我还是忘了

Logo

前往低代码交流专区

更多推荐