Procházet zdrojové kódy

除主账号外不展示code

wangqifan před 2 roky
rodič
revize
169cb35738
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  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
     }