wangqifan 2 лет назад
Родитель
Сommit
169cb35738
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      src/api-users/api-user.controller.ts

+ 4 - 3
src/api-users/api-user.controller.ts

@@ -41,9 +41,10 @@ export class ApiUserController {
     @Get('/get/:id')
     public async get(@Param('id') id: string, @Req() req) {
         const chatRole = await this.apiUserService.findById(Number(id))
-        // if (!req.user || req.user.apiUserId != chatRole.id) {
-        //     chatRole.code = ''
-        // }
+        if (!req.user || req.user.id != chatRole.userId) {
+            chatRole.code = ''
+            chatRole.publicCode = ''
+        }
         return chatRole
     }