


<properties>、、、、<jwt.version>0.9.0</jwt.version></properties><!-- Token生成与解析 --><dependency><groupId>io.jsonwebtoken</groupId><artifactId>jjwt</artifactId><version>${jwt.version}</version></dependency><!-- redis 缓存操作 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency>

#redisredis:# 地址host: localhost# 端口,默认6379port: 6379# 密码password:# 连接超时时间connect-timeout: 10slettuce:pool:# 连接池中最小空闲连接min-idle: 0# 连接池中最大空闲连接max-idle: 8# 连接池的最大数据库连接数max-active: 8# 连接池最大阻塞等待时间(使用负值表示没有限制)max-wait: -1ms# token配置token:# 令牌自定义标识header: Authorization# 令牌秘钥# secret: abcdefghijklmnopqrstuvwxyzsecret: (FRIDAY:)_$^11244^%$_(IS:)_@@++--(COOL:)_++++_.sds_(GUY:)# 令牌有效期(默认30分钟)expireTime: 60



package edu.friday.common.exception.user;import edu.friday.common.exception.BaseException;/*** 用户信息异常类* */public class UserException extends BaseException {private static final long serialVersionUID = 1L;public UserException(String code,Object[] args){super("user",code,args,null);}}
package edu.friday.common.exception.user;/*** 用户密码不正确或不符合规范异常类* */public class UserPasswordNotMatchException extends UserException {private static final long serialVersionUID = 1L;public UserPasswordNotMatchException(){super("user.password.not.match",null);}}



Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号