TokenModel.java
992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.xkl.authorization.model;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* Token的Model类,可以增加字段提高安全性,例如时间戳、url签名
*/
@Data
@AllArgsConstructor
public class TokenModel {
//用户id
private String userId;
//随机生成的uuid
private String token;
//使用openId 登录时,会返回该用户openid对应的account。
private String username;
public TokenModel(String userId, String token) {
this.userId = userId;
this.token = token;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}