@RequestBody前后端传递多个参数
1、前端写法
export const insertOrUpdateVideo = (row, param) => { return request({ url: '/api/video-video/insertOrUpdateVideo', method: 'post', data: { uploadFileId: param.uploadFileId, video: row } }) }
2、后端写法
@PostMapping("/insertOrUpdateVideo") public Result insertOrUpdateVideo(@RequestBody VideoInsertDTO videoInsertDTO) { videoService.insertOrUpdateVideo(videoInsertDTO); return Result.success("mergeResult"); } @Data public class VideoInsertDTO { // 视频上传表id private String uploadFileId; private Video video; }