一、引入依赖
<dependency> <groupId>com.github.binarywang</groupId> <artifactId>wx-java-mp-spring-boot-starter</artifactId> <version>4.0.0</version> </dependency>
二、配置公众号内容
三、核心代码
关键代码 import me.chanjar.weixin.mp.api.WxMpService; @Autowired private WxMpService wxMpService; //mediaID是前台传给你的 -seOcBlnScPObUDYqqvS6bjkXMYMX3oViECw1PE0u6pZ-2ahcKjHA2zeYNS1pv2G File file = wxMpService.getMaterialService().mediaDownload(mediaId);