el-upload uploadParams
时间: 2023-10-15 11:29:43 浏览: 121
el-upload的uploadParams是一个对象,通过这个对象可以设置上传时附带的额外参数。在上传之前,可以通过设置before-upload来动态变化这些参数。比如可以通过before-upload方法来获取token,并将token设置到uploadParams中。例如在before-upload方法中,可以通过this.uploadParams.access_token = window.localStorage.getItem('TOKEN')来设置access_token参数。这样在上传时,uploadParams中的access_token参数就会被传递到后端接口中。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [el-upload文件单独上传和同接口信息一起上传](https://blog.csdn.net/Beam007/article/details/111042667)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文