Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
ldp-docs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
doc
ldp-docs
Commits
7ab34708
Commit
7ab34708
authored
Oct 20, 2021
by
郭人方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs:LDP框架Token工具类说明文档。
parent
5d520fa3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
LDP框架Token工具类说明.md
开发文档/LDP框架Token工具类说明.md
+36
-0
No files found.
开发文档/LDP框架Token工具类说明.md
0 → 100644
View file @
7ab34708
# LDP 框架tokenUtils使用说明文档
本文档是帮助开发者快速熟悉LDP框架中的token使用取值。
UAA-TOKEN创建新增属性:userId、userAccount、userName。
添加token工具类: TokenUtils
依赖包:
<dependency>
<groupId>
com.sinra.ldp
</groupId>
<artifactId>
common-authlocal
</artifactId>
<version>
${ldp.version}
</version>
</dependency>
```
java
import
com.sinra.ldp.authlocal.util.TokenUtils
;
/**
* 使用示例
* @param tokenStr token字符
* @return
*/
public
Object
getToken
(
String
tokenStr
){
//获取所有token值,返回 key-map
Claims
c
=
TokenUtils
.
parseJWT
(
tokenStr
);
//根据token获取userId
TokenUtils
.
getUserId
(
tokenStr
);
//根据token获取userAccount
TokenUtils
.
getUserAccount
(
tokenStr
);
//根据token获取userName
TokenUtils
.
getUserName
(
tokenStr
);
retrun
c
;
}
```
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment