主题
登出功能
登录时,储存用户的token;登出时,清理用户的token。
后台验证token时,如果token不存在或已失效,则验证失败。
相关配置
yaml
pubinfo:
auth:
cache-token-enable: true
token存储方式
redis
pom引入pubinfo-boot-starter-redis即可
yaml
<dependency>
<groupId>cn.zjtele.pubinfo.boot</groupId>
<artifactId>pubinfo-boot-starter-redis</artifactId>
</dependency>
key前缀
yaml
${spring.application.name}:login_token:${userId}
数据库
若pom未引入pubinfo-boot-starter-redis,则使用数据库存储token。
表名:pub_login_token