|
@@ -24,6 +24,7 @@ import org.springframework.security.core.Authentication;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 登录校验方法
|
|
@@ -103,8 +104,8 @@ public class SysLoginService
|
|
|
return authenticate(principal,new UsernamePasswordAuthenticationToken(principal, credential));
|
|
|
} else if (StudentLoginTypeEnum.MOBILELOGIN.getCode().equals(loginType)){
|
|
|
//验证码是否正确
|
|
|
- validateCode(principal,credential);
|
|
|
- return authenticate(principal,new MoblieCodeAuthenticationToken(credential));
|
|
|
+// validateCode(principal,credential);
|
|
|
+ return authenticate(principal,new MoblieCodeAuthenticationToken(principal));
|
|
|
}
|
|
|
else{
|
|
|
throw new CustomException("loginType参数错误");
|
|
@@ -117,7 +118,8 @@ public class SysLoginService
|
|
|
if (StringUtils.isEmpty(credential)){
|
|
|
throw new CustomException("验证码不能为空");
|
|
|
}
|
|
|
- String cacheCode = (String) redisTemplate.opsForValue().get(RedisPrefixUtils.smsRedisPrefix("login", principal));
|
|
|
+ Map map = (Map)RedisPrefixUtils.smsRedisPrefix("login", principal);
|
|
|
+ String cacheCode = (String) redisTemplate.opsForValue().get(map.get("keyPrefix"));
|
|
|
if (StringUtils.isEmpty(cacheCode)){
|
|
|
throw new CustomException("验证码已过期,请重新发送");
|
|
|
}else if (!credential.equals(cacheCode)){
|