|
@@ -93,6 +93,16 @@ public class SmsServiceImpl implements ISmsService {
|
|
|
if (!RegexUtil.checkPhone(phone)) {
|
|
|
return this.buildResultMap(Boolean.FALSE, "手机号不合法, 请重新输入");
|
|
|
}
|
|
|
+ //玩家信息
|
|
|
+ User user = userService.getById(userData.getUserId());
|
|
|
+ if (user == null) {
|
|
|
+ throw new BaseException("参数错误, 用户信息不存在");
|
|
|
+ }
|
|
|
+ //判断玩家是否已经绑定手机号, 且绑定时间未超过1个月
|
|
|
+ if (Strings.isNotBlank(user.getMobile()) && user.getMobileBindTime() != null
|
|
|
+ && ChronoUnit.DAYS.between(user.getMobileBindTime(), LocalDateTime.now()) < 30) {
|
|
|
+ return this.buildResultMap(Boolean.FALSE, "玩家已经绑定过手机号, 不可重复操作");
|
|
|
+ }
|
|
|
//校验手机号是否已经绑定了其他账号
|
|
|
if (userService.count(new LambdaQueryWrapper<User>()
|
|
|
.eq(User::getGameId, userData.getGameId())
|