注意方法参数,我一开始想直接@RequestBody以为可以将数据自动封装成bean,但是不可以,只能通过@RequestParam去手动指定前端传入的数据
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public Result upload(@RequestParam("file") MultipartFile file, @RequestParam String tag) {
}
注意方法参数,我一开始想直接@RequestBody以为可以将数据自动封装成bean,但是不可以,只能通过@RequestParam去手动指定前端传入的数据
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public Result upload(@RequestParam("file") MultipartFile file, @RequestParam String tag) {
}