소스 검색

第三方跳转登录密码问题

deason 4 년 전
부모
커밋
8620b87abb
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/AuthServiceImpl.java

+ 3 - 3
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/AuthServiceImpl.java

@@ -205,7 +205,7 @@ public class AuthServiceImpl implements AuthService {
             if (isSuperAdmin(user)) {
                 byte[] bytes = SHA256.encode(userEntity.getLoginName() + password);
                 String encodePassword = ByteUtil.toHexAscii(bytes);
-                if (!encodePassword.equals(userEntity.getPassword())) {
+                if (!password.equals(userEntity.getPassword()) && !encodePassword.equals(userEntity.getPassword())) {
                     whenLoginError(accountTypeEnum, accountValue, clientIp);
                     throw new StatusException("003003", "账号或密码错误");
                 }
@@ -220,7 +220,7 @@ public class AuthServiceImpl implements AuthService {
                 }
                 byte[] bytes = SHA256.encode(userEntity.getLoginName() + password);
                 String encodePassword = ByteUtil.toHexAscii(bytes);
-                if (!encodePassword.equals(userEntity.getPassword())) {
+                if (!password.equals(userEntity.getPassword()) && !encodePassword.equals(userEntity.getPassword())) {
                     whenLoginError(accountTypeEnum, accountValue, clientIp);
                     throw new StatusException("003003", "账号或密码错误");
                 }
@@ -275,7 +275,7 @@ public class AuthServiceImpl implements AuthService {
                 }
                 byte[] bytes = SHA256.encode(student.getIdentityNumber() + password);
                 String encodePassword = ByteUtil.toHexAscii(bytes);
-                if (!encodePassword.equals(student.getPassword())) {
+                if (!password.equals(student.getPassword()) && !encodePassword.equals(student.getPassword())) {
                     whenLoginError(accountTypeEnum, accountValue, clientIp);
                     throw new StatusException("003003", "账号或密码错误");
                 }