首先el-upload给后台传参是以json的格式,如:
<el-upload
ref="upload"
class="upload-demo"
action="/plan/test"
:data="{test: 1}"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
accept=".xlsx,.xls"
:file-list="confirmList"
>
</el-upload>
后台controller层接受参数格式为:
@RequestMapping("/test")
public void test(@RequestParam(value="test",required=false) int test,@RequestParam("file") MultipartFile file){
System.out.println(test);
}
结果:


本文介绍如何在SpringBoot后端控制器中处理el-upload组件发送的JSON格式参数。
最低0.47元/天 解锁文章
5万+

被折叠的 条评论
为什么被折叠?



