Преглед изворни кода

除主账号外不展示code

wangqifan пре 2 година
родитељ
комит
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')
     @Get('/get/:id')
     public async get(@Param('id') id: string, @Req() req) {
     public async get(@Param('id') id: string, @Req() req) {
         const chatRole = await this.apiUserService.findById(Number(id))
         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
         return chatRole
     }
     }