Skip to content

微服务网关:包含oauth2认证、zuul路由等功能

Notifications You must be signed in to change notification settings

fancyyawn/zhacker-gateway

Repository files navigation

网关设计

代码结构

  • zhacker-discovery: 注册中心
  • zhacker-gateway-passport: 认证中心
  • zhacker-gateway-route: 资源中心
  • zhacker-gateway-admin: 示例应用

如何使用

  1. 下载代码
git clone https://github.com/fancyyawn/zhacker-gateway.git
  1. 启动eureka服务注册中心
mvn spring-boot:run -pl 'zhacker-discovery'
  1. 启动网关的认证中心

本系统依赖于redis,请确保开放了6379端口

mvn spring-boot:run -pl 'zhacker-gateway-passport'
  1. 启动网关的资源中心
mvn spring-boot:run -pl 'zhacker-gateway-route'
  1. 启动一个应用示例
mvn spring-boot:run -pl 'zhacker-gateway-admin'
  1. 下载并启动商品微服务
git clone https://github.com/fancyyawn/zhacker-framework.git
cd zhacker-framework
mvn clean install -Dmaven.test.skip

git clone https://github.com/fancyyawn/zhack-sample-ddd-spu.git
cd zhack-sample-ddd-spu
mvn spring-boot:run
  1. 访问页面
  • 访问应用示例 admin-default
  • 点击登录按钮,跳转到认证中心
  • 输入用户名和密码(admin/123456) oauth-login
  • 跳转到授权页面进行授权 oauth-authorize
  • 跳转回应用首页
  • 通过页面访问后端的服务 admin-logined

About

微服务网关:包含oauth2认证、zuul路由等功能

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages