当前位置:网站首页>项目上传部分
项目上传部分
2022-04-23 07:27:00 【桑英豪】
OSS 通用上传接口
/** * OSS文件上传 * @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添加部分
<el-form-item prop="thumbnail" label="缩略图" :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">将文件拖到此处,或<em>点击上传</em></div> </el-upload> </el-form-item>
![]()
![]()
![]()
版权声明
本文为[桑英豪]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_62902168/article/details/124351929
边栏推荐
- Ubuntu安装Mysql并查询平均成绩
- 总线结构概述
- 每周leetcode - 06 数组专题 7~739~50~offer 62~26~189~9
- 2022.4.11-4.17 AI行业周刊(第93期):AI行业的困局
- Situational leaders - Chapter 7, solving performance problems
- Weekly leetcode - 06 array topics 7 ~ 739 ~ 50 ~ offer 62 ~ 26 ~ 189 ~ 9
- Smart business card applet business card details page function implementation key code
- LeetCode简单题之重新排列日志文件
- 关于ORB——SLAM运行中关键帧位置越来越近的异常说明
- 有意思的js 代码
猜你喜欢

Install MySQL for Ubuntu and query the average score

Campus transfer second-hand market source code download

社区团购小程序源码+界面diy+附近团长+供应商+拼团+菜谱+秒杀+预售+配送+直播

ansible自动化运维详解(一)ansible的安装部署、参数使用、清单管理、配置文件参数及用户级ansible操作环境构建

Distributed service governance Nacos

Detailed explanation of ansible automatic operation and maintenance (I) installation and deployment, parameter use, list management, configuration file parameters and user level ansible operating envi

Search the complete navigation program source code

谈谈那些基础但不简单的股票数据

每周leetcode - 06 数组专题 7~739~50~offer 62~26~189~9

AQS & ReentrantLock 实现原理
随机推荐
Search the complete navigation program source code
An article understands variable lifting
How to import Excel data in SQL server, 2019 Edition
How to read books and papers
一篇文章看懂变量提升(hoisting)
stm32以及freertos 堆栈解析
synchronized 实现原理
Brief description of CPU
ASAN 极简原理
使用JWT生成与解析Token
Rotation function of leetcode medium problem
Usage of databinding
js将树形结构数据转为一维数组数据
每周leetcode - 06 数组专题 7~739~50~offer 62~26~189~9
Qt编译QtXlsx库
The third divisor of leetcode simple question
Green apple film and television system source code film and television aggregation film and television navigation film and television on demand website source code
Positioning of high precision welding manipulator
colorui 解决底部导航遮挡内容问题
Smart business card applet business card details page function implementation key code

