项目实战--在线教育--经验总结(五)

  1. 服务网关:
    1. spring:
        cloud:
          nacos:
            discovery:
              server-addr: 112.125.88.235:8848
      
          gateway:
            discovery:
              locator:
                enabled: true
            routes:
      #      设置服务 service-acl
            - id: SERVICE-ACL #设置路由id
              uri: lb://SERVICE-ACL # 设置路由的uri  : lb://服务名称
              predicates:
            - Path=/*/acl/** # 设置路由断言,代理 serverId 为 auth-service的 路径
      
            - id: SERVICE-EDU
              uri: lb://SERVICE-EDU
              predicates:
            - Path=/edu/** # 路径匹配
      
            - id: SERVICE-UCENTER
              uri: lb://SERVICE-UCENTER
              predicates:
            - Path=/ucenter/** # 路径匹配
      
      
      #      gateway:
      #        #设置路由id
      #        routes[0]:
      #          uri:lb://service-acl #设置路由的uri
      #          predicates:Path=/*/acl/**   #设置路由断言,代理servicerId为auth-service的/auth/路径
      #        routes[1]:  #配置service-edu服务
      #          id:service-edu
      #          uri:lb://service-edu
      #          predicates:Path=/eduservice/**
      #        routes[2]:   #配置service-ucenter服务
      #          id:service-ucenter
      #          uri:lb://service-ucenter
      #          predicates:Path=/ucenterservice/**
      #        routes[3]:  #配置service-ucenter服务
      #          id:service-cms
      #          uri:lb://service-cms
      #          predicates:Path=/cmsservice/**
      #        routes[4]:
      #          id:service-msm
      #          uri:lb://service-msm
      #          predicates:Path=/edumsm/**
      #        routes[5]:
      #          id:service-order
      #          uri:lb://service-order
      #          predicates:Path=/orderservice/**
      #        routes[6]:
      #          id:service-order
      #          uri:lb://service-order
      #          predicates:Path=/orderservice/**
      #        routes[7]:
      #          id:service-oss
      #          uri:lb://service-oss
      #          predicates:Path=/eduoss/**
      #        routes[8]:
      #          id:service-statistic
      #          uri:lb://service-statistic
      #          predicates:Path=/staservice/**
      #        routes[9]:
      #          id:service-vod
      #          uri:lb://service-vod
      #          predicates:Path=/eduvod/**
      #        routes[10]:
      #          id:service-edu
      #          uri:lb://service-edu
      #          predicates:Path=/eduuser/**
  2. 权限管理:

    1. 菜单管理

    2. 角色管理:创建角色,为角色分配菜单

    3. 为用户人员分配角色

  3.  Spring security:

  4. Nacos配置中心:

  5.  配置中心,引入多配置文件:

    1.  

       

    2.  

       

        

            

          

       

          
posted @ 2021-11-26 02:11  张紫韩  阅读(37)  评论(0编辑  收藏  举报