无关风月
2025-04-11 75942ecc2e438012c5ea876715966ace593565a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Spring
spring:
  application:
    # 应用名称
    name: ruoyi-study
  main:
    allow-bean-definition-overriding: true
  profiles:
    # 环境配置
    active: dev
---
spring:
  config:
    activate:
      on-profile: dev
  cloud:
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 127.0.0.1:8848
        service: ${spring.application.name}
        group: DEFAULT_GROUP
        namespace: f6f73ac0-b694-453a-bd34-ecc088491ceb
      config:
        # 配置中心地址
        server-addr: 127.0.0.1:8848
        namespace: f6f73ac0-b694-453a-bd34-ecc088491ceb
        group: DEFAULT_GROUP
        name: ${spring.application.name}
        # 配置文件格式
        file-extension: yml
        # 共享配置
        shared-configs:
          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
---
spring:
  config:
    activate:
      on-profile: prod
  cloud:
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 127.0.0.1:8848
        service: ${spring.application.name}
        group: DEFAULT_GROUP
        namespace: 39e64e1d-89ac-48a4-9b31-8ebb0d23b76f
      config:
        # 配置中心地址
        server-addr: 127.0.0.1:8848
        namespace: 39e64e1d-89ac-48a4-9b31-8ebb0d23b76f
        group: DEFAULT_GROUP
        name: ${spring.application.name}
        # 配置文件格式
        file-extension: yml
        # 共享配置
        shared-configs:
          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}