当我把OSS的配置写在application.yml上是,微服务可以正常执行。
但当我把OSS放在Nacos配置中心上时,微服务报错提示Oss endpoint can‘t be empty.
此时我排除网上所说的版本问题和配置格式问题,我开始认为是bootstrap.properties没有生效,于是我翻阅资料找到原因,
应该在pom.xml中加入这个依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
重新运行项目,成功!!!!