跳到主要内容

fastDFS

依赖引入

//若已引过则无需重复引
<dependency>
<groupId>com.manatee.manatee-lowcode</groupId>
<artifactId>lowcode-file</artifactId>
<version>${lowcode.version}</version>
</dependency>

启动类改造

@Import(FdfsClientConfig.class) //将 fdfs 类装配到spring容器中
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING) // 解决jmx重复注册bean的问题

配置文件

fdfs:
so-timeout: 1501
connect-timeout: 601
thumb-image: #缩略图生成参数
width: 150
height: 150
reqHost: http://{host} #fdfs 的 nginx 访问地址,用于文件访问,开发时通过函数 getSpringProperties("fdfs.reqHost") 获取到
tracker-list: #TrackerList参数,支持多个
- xx.xx.x.xx:22122