当前位置:网站首页>Project upload part
Project upload part
2022-04-23 09:01:00 【Sang Yinghao】
OSS Universal upload interface
/** * OSS Upload files * @param file * @return */ @PostMapping("/uploadFileByOSS") public ResultJson uploadFileByOSS(MultipartFile file){ try { QueryWrapper<OssConfig> ossConfigQueryWrapper = new QueryWrapper<>(); ossConfigQueryWrapper.last("limit 1"); OssConfig ossConfig = ossConfigService.getOne(ossConfigQueryWrapper); return ResultJson.ok(OssUtils.alibabaUploadFile(file, ossConfig)); } catch (Exception e) { log.error(e.getMessage()); return ResultJson.failure(ResultCode.BAD_REQUEST, e.getMessage()); } }
html Add part
<el-form-item prop="thumbnail" label=" thumbnail " :label-width="dialogFormLabelWidth" style="width:325px"> <span> <img width="100%" :src="uploadUrlPath" alt=""> </span> <el-upload drag :action="uploadOSS" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload" :on-error="handleUploadError" name="file" :show-file-list="false" :headers="headers" > <i class="el-icon-upload"></i> <div class="el-upload__text"> Drag files here , or <em> Click upload </em></div> </el-upload> </el-form-item>
![]()
![]()
![]()
版权声明
本文为[Sang Yinghao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230726461841.html
边栏推荐
- First principle mind map
- Technological innovation in government affairs in the construction of Digital Government
- Pctp test experience sharing
- Summary of solid problems
- 扣缴义务人
- 完全二叉搜索树 (30 分)
- Initial experience of talent plan learning camp: communication + adhering to the only way to learn open source collaborative courses
- L2-024 tribe (25 points) (and check the collection)
- Virtual online exhibition - Online VR exhibition hall realizes 24h immersive exhibition viewing
- valgrind和kcachegrind使用运行分析
猜你喜欢
Idea package jar file
经典题目刷一刷
Cadence process angle simulation, Monte Carlo simulation, PSRR
Download and install bashdb
K210 learning notes (II) serial communication between k210 and stm32
在sqli-liabs学习SQL注入之旅(第十一关~第二十关)
Idea import commons-logging-1.2 Jar package
L2-024 部落 (25 分)(并查集)
Notes on xctf questions
Brief steps to build a website / application using flash and H5
随机推荐
Go language self-study series | golang nested structure
Open services in the bottom bar of idea
Cadence process angle simulation, Monte Carlo simulation, PSRR
Notes on xctf questions
2022-04-22 OpenEBS云原生存储
PLC point table (register address and point table definition) cracking detection scheme -- convenient for industrial Internet data acquisition
LGB, XGB, cat, k-fold cross validation
【58】最后一个单词的长度【LeetCode】
Four pictures to understand some basic usage of Matplotlib
Introduction to matlab
The most concerned occupations after 00: civil servants ranked second. What was the first?
Correct method of calculating inference time of neural network
First principle mind map
[58] length of the last word [leetcode]
Applet in wechat and app get current ()
计算神经网络推理时间的正确方法
Valgrind et kcachegrind utilisent l'analyse d'exécution
BK3633 规格书
Mini - exercice MySQL (seulement pour les débutants, pas pour les non - débutants)
Valgrind and kcache grind use run analysis