瀏覽代碼

fix : 小游戏玩家导量到H5游戏3

bilingfeng 1 年之前
父節點
當前提交
859356038d

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -21,7 +21,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, 小游戏玩家导量到H5游戏2> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, 小游戏玩家导量到H5游戏3> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 6 - 6
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java

@@ -87,18 +87,18 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         if (user == null) {
             throw new BaseException("参数错误, 用户信息不存在");
         }
+        //查询H5游戏
+        GameDTO h5GameDTO = gameService.getById(gameService.getById(user.getGameId()).getH5GameId());
+        if (h5GameDTO == null) {
+            throw new BaseException("参数错误, 关联H5游戏信息不存在");
+        }
         //判断手机号是否被该游戏其他用户绑定
         int count = super.count(new LambdaQueryWrapper<User>()
-                .eq(User::getGameId, user.getGameId())
+                .eq(User::getGameId, h5GameDTO.getId())
                 .eq(User::getMobile, mobile));
         if (count > 0) {
             throw new BaseException("参数错误, 该手机号已被该游戏其他玩家信息绑定");
         }
-        //查询H5游戏
-        GameDTO h5GameDTO = gameService.getById(gameService.getById(user.getGameId()).getH5GameId());
-        if (h5GameDTO == null) {
-            throw new BaseException("参数错误, 关联H5游戏信息不存在");
-        }
         //复制用户信息
         User h5User = BeanUtil.copy(user, User.class);
         h5User.setId(null);