feat: fix bugs
This commit is contained in:
@@ -32,7 +32,7 @@ public class UserInfoUtil<T> {
|
|||||||
if (date.getTime() > expireData.getTime()) {
|
if (date.getTime() > expireData.getTime()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (T) shiroService.findByUserId(ftToken.getUserId());
|
return (T) shiroService.findByUserId(String.valueOf(ftToken.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class CustomRealm extends AuthorizingRealm {
|
|||||||
} else {
|
} else {
|
||||||
//1. 根据accessToken,查询用户信息
|
//1. 根据accessToken,查询用户信息
|
||||||
FtToken tokenEntity = shiroService.findByToken(accessToken);
|
FtToken tokenEntity = shiroService.findByToken(accessToken);
|
||||||
userId = tokenEntity.getUserId();
|
userId = String.valueOf(tokenEntity.getUserId());
|
||||||
//2. token失效
|
//2. token失效
|
||||||
if (tokenEntity.getExpireTime().getTime() < System.currentTimeMillis()) {
|
if (tokenEntity.getExpireTime().getTime() < System.currentTimeMillis()) {
|
||||||
throw new IncorrectCredentialsException("token失效,请重新登录");
|
throw new IncorrectCredentialsException("token失效,请重新登录");
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class FtToken implements Serializable {
|
|||||||
|
|
||||||
private String token;
|
private String token;
|
||||||
|
|
||||||
private String userId;
|
private Integer userId;
|
||||||
|
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class ShiroServiceImpl implements ShiroService {
|
|||||||
Map<String, Object> map = baseMapper.selectOneByCondition("FT_TOKEN", condition);
|
Map<String, Object> map = baseMapper.selectOneByCondition("FT_TOKEN", condition);
|
||||||
osToken.setToken((String) map.get("TOKEN"));
|
osToken.setToken((String) map.get("TOKEN"));
|
||||||
osToken.setTokenId((String) map.get("TOKEN_ID"));
|
osToken.setTokenId((String) map.get("TOKEN_ID"));
|
||||||
osToken.setUserId((String) map.get("USER_ID"));
|
osToken.setUserId((Integer) map.get("USER_ID"));
|
||||||
osToken.setExpireTime((Date) map.get("EXPIRE_TIME"));
|
osToken.setExpireTime((Date) map.get("EXPIRE_TIME"));
|
||||||
osToken.setUpdateTime((Date) map.get("UPDATE_TIME"));
|
osToken.setUpdateTime((Date) map.get("UPDATE_TIME"));
|
||||||
return osToken;
|
return osToken;
|
||||||
|
|||||||
@@ -229,4 +229,16 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>releases</id>
|
||||||
|
<name>Releases</name>
|
||||||
|
<url>http://192.168.0.123:8081/repository/maven-releases/</url>
|
||||||
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>snapshots</id>
|
||||||
|
<name>Snapshot</name>
|
||||||
|
<url>http://192.168.0.123:8081/repository/maven-snapshots/</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
</distributionManagement>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
Reference in New Issue
Block a user