|
|
@ -19,6 +19,7 @@ import com.blockchain.server.user.common.utils.SmsCodeUtils; |
|
|
|
import com.blockchain.server.user.controller.api.LoginApi; |
|
|
|
import com.blockchain.server.user.controller.api.LoginApi; |
|
|
|
import com.blockchain.server.user.dto.UserBaseDTO; |
|
|
|
import com.blockchain.server.user.dto.UserBaseDTO; |
|
|
|
import com.blockchain.server.user.entity.UserMain; |
|
|
|
import com.blockchain.server.user.entity.UserMain; |
|
|
|
|
|
|
|
import com.blockchain.server.user.entity.YyyfUser; |
|
|
|
import com.blockchain.server.user.service.*; |
|
|
|
import com.blockchain.server.user.service.*; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
@ -197,6 +198,7 @@ public class LoginController { |
|
|
|
smsCodeUtils.validateVerifyCode(code, tel, SmsCountEnum.SMS_COUNT_REGISTER); |
|
|
|
smsCodeUtils.validateVerifyCode(code, tel, SmsCountEnum.SMS_COUNT_REGISTER); |
|
|
|
UserMain userMain = userMainService.handleRegister(tel, invitationCode, internationalCode, password, nickName); |
|
|
|
UserMain userMain = userMainService.handleRegister(tel, invitationCode, internationalCode, password, nickName); |
|
|
|
smsCodeUtils.removeKey(tel, SmsCountEnum.SMS_COUNT_REGISTER); |
|
|
|
smsCodeUtils.removeKey(tel, SmsCountEnum.SMS_COUNT_REGISTER); |
|
|
|
|
|
|
|
|
|
|
|
return handleAfterLogin(userMain, TokenTypeEnums.PC.getValue(), request); |
|
|
|
return handleAfterLogin(userMain, TokenTypeEnums.PC.getValue(), request); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -280,12 +282,17 @@ public class LoginController { |
|
|
|
YyyfUserDto yyyfUserDto = (YyyfUserDto) redisTemplate.opsForValue().get(yyyfTtoken); |
|
|
|
YyyfUserDto yyyfUserDto = (YyyfUserDto) redisTemplate.opsForValue().get(yyyfTtoken); |
|
|
|
yyyfUserId = yyyfUserDto.getId(); |
|
|
|
yyyfUserId = yyyfUserDto.getId(); |
|
|
|
String userId =userMain.getId(); |
|
|
|
String userId =userMain.getId(); |
|
|
|
int count = this.yyyfUserService.selectCountByYyyfUserIdAndUserId(yyyfUserId, userId); |
|
|
|
YyyfUser yyyfUser = this.yyyfUserService.selectByYyyfUserIdAndTel(yyyfUserId, userMain.getMobilePhone()); |
|
|
|
if (count == 0) { |
|
|
|
if (yyyfUser == null) { |
|
|
|
this.yyyfUserService.saveUser(yyyfUserId, userId, yyyfUserDto.getName()); |
|
|
|
this.yyyfUserService.saveUser(yyyfUserId, userId, yyyfUserDto.getName()); |
|
|
|
this.redisTemplate.delete(yyyfTtoken); |
|
|
|
this.redisTemplate.delete(yyyfTtoken); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
if(!yyyfUser.getUserId().equals(userMain.getId())){ |
|
|
|
|
|
|
|
throw new UserException(UserEnums.USER_NOT_FORBID_OTHER_USER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
throw new UserException(UserEnums.USER_NOT_BIND_YYYF); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
@ -330,4 +337,5 @@ public class LoginController { |
|
|
|
// smsCountService.handleInsertSmsCode(tel, internationalCode, SmsCountEnum.SMS_COUNT_FORGET_PASSWORD);
|
|
|
|
// smsCountService.handleInsertSmsCode(tel, internationalCode, SmsCountEnum.SMS_COUNT_FORGET_PASSWORD);
|
|
|
|
return ResultDTO.requstSuccess(); |
|
|
|
return ResultDTO.requstSuccess(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|