|
|
|
@ -985,6 +985,10 @@ public class SysUserService implements ISysUserService {
|
|
|
|
|
public SysUser validatePasswordByLoginNameAndReturnUser(String loginName, String password) {
|
|
|
|
|
SysUser userDb = getSysUserByLoginName(loginName);
|
|
|
|
|
ValidatorBean.checkNotNull(userDb, "不存在的用户信息");
|
|
|
|
|
//由于数据库的字符集不区分大小写,所以需要根据用户名查询出来后再次比对
|
|
|
|
|
if (!userDb.getUserLoginName().equals(loginName)){
|
|
|
|
|
throw new IncorrectCredentialsException("用户名或密码错误");
|
|
|
|
|
}
|
|
|
|
|
if (userDb.getUserLoginPasswordId() == null || userDb.getUserLoginPasswordId() <= 0) {
|
|
|
|
|
if (!userDb.getUserLoginPassword().equals(SysUserPasswordUtil.encoder(password))) {
|
|
|
|
|
throw new IncorrectCredentialsException("用户密码错误");
|
|
|
|
|