db-token校验过期时间

master
zhangw 2018-05-19 10:19:26 +08:00
parent 578698bee4
commit cf2a5a0498
1 changed files with 7 additions and 1 deletions

View File

@ -140,7 +140,13 @@ public class TokenServiceDbImpl implements TokenService {
if (model == null) {
return null;
}
return JSONObject.parseObject(model.getVal(), LoginUser.class);
// 校验是否已过期
if (model.getExpireTime().getTime() > System.currentTimeMillis()) {
return JSONObject.parseObject(model.getVal(), LoginUser.class);
}
return null;
}
private Key getKeyInstance() {