同步框架更新
This commit is contained in:
@ -243,10 +243,10 @@ public class LoginServiceImpl implements ILoginService {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断用户名和密码是否正确,有2中情况,1:账号密码登录,2:互信token登录,
|
||||
* 方式1是传入的未加密的密码,方式2传入的是通过md5已加密的密码,所以通过判断密码的长度来判断是否已加密
|
||||
* */
|
||||
/**
|
||||
* 判断用户名和密码是否正确,有2中情况,1:账号密码登录,2:互信token登录,
|
||||
* 方式1是传入的未加密的密码,方式2传入的是通过md5已加密的密码,所以通过判断密码的长度来判断是否已加密
|
||||
* */
|
||||
public boolean checkPassword(User loginUser,LoginDto dto)
|
||||
{
|
||||
//如果长度是32,即传入的是密文
|
||||
@ -254,7 +254,7 @@ public class LoginServiceImpl implements ILoginService {
|
||||
return (loginUser == null || !StrUtil.equals(loginUser.getPassword(), dto.getPassword()));
|
||||
}
|
||||
else {
|
||||
return (loginUser == null || !StrUtil.equals(loginUser.getPassword(), SaSecureUtil.md5BySalt(dto.getPassword(), GlobalConstant.SECRET_KEY)));
|
||||
return (loginUser == null || !StrUtil.equals(loginUser.getPassword(), SaSecureUtil.md5BySalt(dto.getPassword(), GlobalConstant.SECRET_KEY)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -204,7 +204,11 @@ public class SsoServiceImpl implements SsoService {
|
||||
|
||||
@Override
|
||||
public String auth(String ltpasToken){
|
||||
|
||||
String loginid = this.decodeToken(ltpasToken);
|
||||
if(openLoginLog){
|
||||
log.info("秘钥 {} 解码后的用户名是:{}",ltpasToken,loginid);
|
||||
}
|
||||
if(StringUtils.isNotBlank(loginid)){
|
||||
return loginid;
|
||||
}
|
||||
@ -377,6 +381,9 @@ public class SsoServiceImpl implements SsoService {
|
||||
}
|
||||
|
||||
private String decodeToken(String ltpasToken) {
|
||||
if(openLoginLog){
|
||||
log.info("登录秘钥是:{} ",ltpasToken);
|
||||
}
|
||||
if (StringUtils.isEmpty(ltpasToken)) {
|
||||
return null;
|
||||
}
|
||||
@ -392,6 +399,11 @@ public class SsoServiceImpl implements SsoService {
|
||||
}
|
||||
Long begin = Long.parseLong(ltpasTokenInfo[1]);
|
||||
Long end = Long.parseLong(ltpasTokenInfo[2]);
|
||||
|
||||
if(openLoginLog){
|
||||
log.info("互信秘钥解密过程参数:now:{},ltpasTokenDecode:{},secretKey:{}",now,ltpasTokenDecode,secretKey);
|
||||
}
|
||||
|
||||
if(now >= begin && now <= end) {
|
||||
return eIN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user