|
|
@@ -8,6 +8,7 @@ import com.sckw.auth.model.vo.res.EntInfoResVo;
|
|
|
import com.sckw.auth.model.vo.res.LoginResVo;
|
|
|
import com.sckw.auth.model.vo.res.LoginResVo1;
|
|
|
import com.sckw.auth.util.AsyncFactory;
|
|
|
+import com.sckw.core.common.enums.enums.DictEnum;
|
|
|
import com.sckw.core.model.enums.ClientTypeEnum;
|
|
|
import com.sckw.core.model.enums.LoginMethodEnum;
|
|
|
import com.sckw.core.model.enums.SystemTypeEnum;
|
|
|
@@ -177,15 +178,11 @@ public class AuthServiceImpl implements IAuthService {
|
|
|
@Transactional(rollbackFor = {})
|
|
|
public void register(RegisterReqVo reqVo) {
|
|
|
/*校验验证码*/
|
|
|
- String key = Global.USER_LOGIN_CAPTCHA + reqVo.getPhone() + Global.COLON + reqVo.getSystemType();
|
|
|
+ String key = StringUtils.format(RedisConstant.MESSAGE_SMS_VERIFY_CODE_VALUE_KEY, DictEnum.SMS_REGISTER.getValue(), reqVo.getPhone());
|
|
|
String sms = RedissonUtils.getString(key);
|
|
|
-// if (!reqVo.getCaptcha().equals(sms)) {
|
|
|
-// throw new SystemException(HttpStatus.CODE_10301, HttpStatus.CAPTCHA_ERROR);
|
|
|
-// }
|
|
|
- if (!"12345".equals(reqVo.getCaptcha())) {
|
|
|
+ if (!reqVo.getCaptcha().equals(sms)) {
|
|
|
throw new SystemException(HttpStatus.CODE_10301, HttpStatus.CAPTCHA_ERROR);
|
|
|
}
|
|
|
-
|
|
|
RegisterReqDto registerReqDto = new RegisterReqDto();
|
|
|
BeanUtils.copyProperties(reqVo, registerReqDto);
|
|
|
remoteUserService.register(registerReqDto);
|
|
|
@@ -193,35 +190,11 @@ public class AuthServiceImpl implements IAuthService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Override
|
|
|
- public void forgetPassword(ForgetPasswordReqVo reqDto) throws SystemException {
|
|
|
- ForgetPasswordReqDto forgetPasswordReqDto = new ForgetPasswordReqDto();
|
|
|
- BeanUtils.copyProperties(reqDto, forgetPasswordReqDto);
|
|
|
- remoteUserService.forgetPassword(forgetPasswordReqDto);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updatePassword(UpdatePasswordReqVo reqVo) throws SystemException {
|
|
|
- UpdatePasswordReqDto updatePassword = new UpdatePasswordReqDto();
|
|
|
- BeanUtils.copyProperties(reqVo, updatePassword);
|
|
|
- remoteUserService.updatePassword(updatePassword);
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public void resetPassword(Long id) {
|
|
|
remoteUserService.resetPassword(id);
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public String getRegisterSms(GetRegisterSmsReqVo reqVo) {
|
|
|
- String code = "";
|
|
|
- remoteUserService.checkRegisterParam(reqVo.getEntName(), reqVo.getPhone(), reqVo.getSystemType());
|
|
|
- String key = Global.USER_LOGIN_CAPTCHA + reqVo.getPhone() + Global.COLON + reqVo.getSystemType();
|
|
|
- RedissonUtils.put(key, code, 30L);
|
|
|
- return code;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
static class AsyncProcess implements Runnable {
|
|
|
|
|
|
private final LoginResVo loginResVo;
|