dcs před 11 měsíci
rodič
revize
67194a1efd

+ 2 - 5
virgo.core/src/main/java/com/bosshand/virgo/core/shiro/UserRealm.java

@@ -39,14 +39,11 @@ public class UserRealm extends AuthorizingRealm {
 		if (mgrUser == null) {
 			throw new AuthenticationException("该用户不存在");
 		}
-		
-		
+
 		if (mgrUser.getStatus() == 1) {
 			throw new AuthenticationException("该用户已被封号");
 		}
-		//return new SimpleAuthenticationInfo(phone, CodeCache.getKey(phone), "UserRealm");
-		// TODO 测试用的,上面的测试好放开
-		return new SimpleAuthenticationInfo(phone, CodeCache.DefaultPhoneCode, "UserRealm");
+		return new SimpleAuthenticationInfo(phone, CodeCache.getKey(phone), "UserRealm");
 	}
 
 	@Override

+ 2 - 4
virgo.core/src/main/java/com/bosshand/virgo/core/shiro/VirgoAuthenticationFilter.java

@@ -110,15 +110,13 @@ public class VirgoAuthenticationFilter extends AuthenticatingFilter {
 			}
 
 			// 超级管理员登录
-			if (CodeCache.DefaultPhone.equals(dto.getPhone())) {
+			if (CodeCache.DefaultPhone.contains(dto.getPhone())) {
 				CodeCache.setKey(dto.getPhone(), CodeCache.DefaultPhoneCode);
 				return createToken(dto.getPhone(), CodeCache.DefaultPhoneCode, request, response);
 			}
 
 			// 手机号验证码注册登录
-			//phoneCode = CodeCache.getKey(dto.getPhone());
-			// TODO 测试用的,上面的测试好放开
-			phoneCode = CodeCache.DefaultPhoneCode;
+			phoneCode = CodeCache.getKey(dto.getPhone());
 			if (!dto.getPhoneCode().equals(phoneCode)) {
 				log.error("手机号验证码注册登录,验证码有误");
 				return createToken(null, null, request, response);

+ 1 - 1
virgo.core/src/main/java/com/bosshand/virgo/core/utils/CodeCache.java

@@ -10,7 +10,7 @@ import java.util.concurrent.TimeUnit;
 
 public class CodeCache {
 
-    public static final String DefaultPhone = "18888888888";
+    public static final String DefaultPhone = "18888888888,17777777777,17698569102,17698963228,16666666666,17711111111,17711111112,17711112222";
 
     public static final String DefaultPhoneCode = "888888";