This action will force synchronization from Object_Zhang/spring-boot-cloud, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
本项目是一个基于 Spring Boot、Spring Cloud、Spring Oauth2 和 Spring Cloud Netflix 等框架构建的微服务项目。
该项目包含 8 个服务
mvn clean package
打包项目及 Docker 镜像docker-compose up -d
启动所有项目127.0.0.1 registry config monitor rabbitmq auth-service
访问 http://localhost:8761/ 默认账号 user,密码 password
访问 http://localhost:8040/ 默认账号 admin,密码 admin
访问 http://localhost:9411/ 默认账号 admin,密码 admin
Docker 启动访问 http://localhost:15673/ 默认账号 guest,密码 guest(本地 rabbit 管理系统默认端口15672)
curl -X POST -vu client:secret http://localhost:8060/uaa/oauth/token -H "Accept: application/json" -d "password=password&username=anil&grant_type=password&scope=read%20write"
返回如下格式数据:
{
"access_token": "eac56504-c4f0-4706-b72e-3dc3acdf45e9",
"token_type": "bearer",
"refresh_token": "da1007dc-683c-4309-965d-370b15aa4aeb",
"expires_in": 3599,
"scope": "read write"
}
curl -i -H "Authorization: Bearer eac56504-c4f0-4706-b72e-3dc3acdf45e9" http://localhost:8060/svca
返回如下数据:
svca-service (172.18.0.8:8080)===>name:zhangxd
svcb-service (172.18.0.2:8070)===>Say Hello
curl -i -H "Authorization: Bearer eac56504-c4f0-4706-b72e-3dc3acdf45e9" http://localhost:8060/svcb
返回如下数据:
svcb-service (172.18.0.2:8070)===>Say Hello
curl -X POST -vu client:secret http://localhost:8060/uaa/oauth/token -H "Accept: application/json" -d "grant_type=refresh_token&refresh_token=da1007dc-683c-4309-965d-370b15aa4aeb"
返回更新后的 Token:
{
"access_token": "63ff57ce-f140-482e-ba7e-b6f29df35c88",
"token_type": "bearer",
"refresh_token": "da1007dc-683c-4309-965d-370b15aa4aeb",
"expires_in": 3599,
"scope": "read write"
}
curl -X POST -vu user:password http://localhost:8888/bus/refresh
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。