Commit 7ab34708 authored by 郭人方's avatar 郭人方

docs:LDP框架Token工具类说明文档。

parent 5d520fa3
# 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment