@NoArgsConstructor
@AllArgsConstructor
public class CurrentUser {
/**
- 用户ID
*/
private Long userId;
/**
- 姓名
*/
private String name;
/**
- 手机号
*/
private String mobile;
/**
- 邮箱
*/
private String email;
/**
- 登录过期时间(24小时)
*/
private static final long TOKEN_EXPIRE_TIME = 10006060*24;
/**
- 登录加解密钥
*/
private static final String TOKEN_SECRET = “XZH-TOKEN”;
/**
- 登录用户token key
*/
private static final String TOKEN_KEY = “token”;
/**
-
从token获取当前用户信息
-
@return 当前用户
*/
public static CurrentUser get(){
RequestAttributes requestAttributes = RequestContextH