1、新增共享配置文件
2、总结分析
1、共享配置文件命名规范:服务名称 . 文件后缀
环境配置文件命名规范:服务名称 - 服务环境 . 文件后缀
spring: application: name: userService # 服务名称
spring: profiles: active: dev # 服务环境
spring: cloud: nacos: config: file-extension: yaml # 文件后缀
2、当遇到开发、测试、生产环境都共有的参数那么可以考虑使用共享配置文件
2、配置文件执行顺序:
环境配置文件 > 共享配置文件 > 本地配置
以上内容来自黑马程序员,课程学习节奏循序渐进。本人学习后