Browse Source

-fix : 客服权限额外添加兼容

bilingfeng 8 months ago
parent
commit
267265e96d

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

@@ -23,7 +23,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 < (服务器迁移, 修正DUBBO通信问题・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 < (客服权限额外添加兼容・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 1 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/api/CpServerApiService.java

@@ -45,6 +45,7 @@ public class CpServerApiService {
     private RestTemplate restTemplate;
 
     public boolean chatMsgSubmit(ChatSubmitParam param) {
+        log.error("收到游戏聊天内容, param : {}", JsonUtil.toString(param));
         GameSupper gameSupper = gameSupperService.getById(param.getGameId());
         if (gameSupper == null) {
             throw new BaseException("参数错误");

+ 2 - 8
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameAuthRoleServiceImpl.java

@@ -89,16 +89,10 @@ public class GameAuthRoleServiceImpl extends ServiceImpl<GameAuthRoleMapper, Gam
 
     @Override
     public boolean isCustomer() {
-        //开后门, 开发调试问题的时候用
-        if (SecurityUtil.isAdmin()) {
-            List<Long> backDoorIds = Arrays.asList(123L, 220L);
-            if (backDoorIds.contains(SecurityUtil.getUserId())) {
-                return Boolean.TRUE;
-            }
-        }
         return super.count(new LambdaQueryWrapper<GameAuthRole>()
-                .eq(GameAuthRole::getAuthType, GameAuthEnum.CUSTOMER.getValue())
                 .eq(GameAuthRole::getUserId, SecurityUtil.getUserId())
+                .and(qw -> qw.eq(GameAuthRole::getAuthType, GameAuthEnum.CUSTOMER.getValue())
+                        .or().eq(GameAuthRole::getCustomerPower, Boolean.TRUE))
         ) > 0;
     }
 

+ 5 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameAuthRole.java

@@ -65,4 +65,9 @@ public class GameAuthRole implements Serializable {
      * 更新时间
      */
     private LocalDateTime updateTime;
+
+    /**
+     * 客服权限
+     */
+    private Boolean customerPower;
 }