同步操作将从 open-hand/choerodon-starters 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
This project is a jar package. It is a basic repository of Choerodon. It provides resource services to check JWT_TOKEN
when accepting http requests, and captures the exceptions of controller
uniformly, and converts it into user language corresponding description information.
The dependencies of pom:
<dependency>
<groupId>io.choerodon</groupId>
<artifactId>choerodon-starter-oauth-resource</artifactId>
<version>0.10.1.RELEASE</version>
</dependency>
1.Check the legality of the access token
that is carried when accessing the service.
HttpMethod
for OPTIONS
JWT_TOKEN
in the head information of the HTTP.JWT_TOKEN
uses a custom conversion method to resolve.Usage:
The repository configures the type of interfaces that need to validate token
. After referencing the repository, you need to add the annotation @EnableChoerodonResourceServer
to the application
startup class. The service will automatically verify the JWT_TOKEN
.
The verified url defaults to /v1/*
. You can also customize the path type of the request to be verified. Add choerodon.resource.pattern=/v2/*,/v3/*
in the spring-boot configuration file.
When testing locally, you need to add {"Jwt_Token" : "Bearer jwt_token"}
to the header.
2.Unified capture and processing of service control class exceptions.
Exception Response
CommonException
, NotFoundException
, MethodArgumentNotValidException
, DuplicateKeyException
, MultipartException
, BadSqlGrammarException
.Usage:
In the business development of the service, throwing the above exceptions into the controller
layer can be captured and returned with custom description information.
throw new CommonException("error message");
3.Method for serializing and deserializing time based on time zone of user.
If you find any shortcomings or bugs, please describe them in the Issue.
Pull requests are welcome! Follow this link for more information on how to contribute.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。