目录
1、在pom.xml中添加如下依赖
<dependency> <groupId>com.aliyun.oss</groupId> <artifactId>aliyun-sdk-oss</artifactId> <version>3.8.0</version> </dependency>
2、在application.yml中添加如下配置
oss: host: http://xxxx.oss-cn-shenzhen.aliyuncs.com bucketName: xxxx-uxm endpoint: oss-cn-shenzhen.aliyuncs.com accessKeyId: xxxx6rZ7etOfxxx accessKeySecret: xxxxxxxxxLc8NUoTTrmxxxxxxxxx
3、创建文件上传工具类
文件上传工具类:
/**