项目地址:https://github.com/liangjinquan17/spring-security-demo
目的:自定义token内容,设置token生成方式为jwt
1.导包
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.1.1.RELEASE</version>
</dependency>
2.编写token转换器和token增强器
添加tokenEnhancer
3.查看结果