|
|
@@ -38,7 +38,7 @@ public class LoginByCodeManager extends AbstractLoginManager implements LogManag |
|
|
|
if (!smsCode.equals(request.getCode())) |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("短信验证码错误!"); |
|
|
|
AccountInfo accountInfo = accountInfoRepo.findByAccount(request.getMobile()); |
|
|
|
if (accountInfo == null) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("手机号输入错误"); |
|
|
|
if (accountInfo == null) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("账号不存在"); |
|
|
|
findAndValidStaff(accountInfo.getOpenId(), request.getLoginSource()); |
|
|
|
String code = UUID.randomUUID().toString().replaceAll("-", "");// code用于换Token,还完Token就没用了 |
|
|
|
redisManager.set(RedisKeyGenerator.getLoginOpenIdByCodeKey(code, request.getLoginSource().name()), accountInfo.getOpenId(), LoginCacheFinals.LOGIN_CODE_EXPIRED, TimeUnit.MINUTES); |