Parcourir la source

Merge remote-tracking branch 'origin/package' into package

zhangxianyu il y a 1 mois
Parent
commit
749e4dadd7

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java

@@ -25,7 +25,7 @@ public class SDKApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <角色信息上报接口更新, 腾讯媒体sdk回传更新> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <角色绑定手机号, 判断是否重复操作01> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +

+ 10 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/SmsServiceImpl.java

@@ -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())