Quellcode durchsuchen

1、获取未读站内信数量接口调整

dongpo vor 3 Wochen
Ursprung
Commit
9a6368afe2

+ 6 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyMessageController.java

@@ -119,8 +119,13 @@ public class NotifyMessageController {
     @Operation(summary = "获得当前用户的未读站内信数量")
     @ApiAccessLog(enable = false) // 由于前端会不断轮询该接口,记录日志没有意义
     public CommonResult<Long> getUnreadNotifyMessageCount() {
+        Long loginUserId = getLoginUserId();
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
+        if (loginEmployee == null) {
+            return success(0L);
+        }
         return success(notifyMessageService.getUnreadNotifyMessageCount(
-                getLoginUserId(), UserTypeEnum.ADMIN.getValue()));
+                loginEmployee.getId(), UserTypeEnum.MEMBER.getValue()));
     }
 
 }