fix: resolve 3 review findings (permission codes, profile guard, JSDoc)

This commit is contained in:
2026-07-02 12:22:49 +08:00
parent 75acb5c7a2
commit ef645c0f40
85 changed files with 15566 additions and 7 deletions

View File

@@ -35,6 +35,7 @@ export class AuthController {
}
}
@Public()
@UseGuards(JwtAuthGuard)
@Get('profile')
getProfile(@Request() req: any) {

View File

@@ -4,8 +4,8 @@ export const PERMISSION_KEY = 'permissions';
/**
* 声明接口所需权限。
* 多次调用 = AND 逻辑(需要同时满足所有组);
* 单次调用多个参数 = OR 逻辑(满足其中一个即可)
* 多个参数之间为 OR 关系(用户拥有其中任一权限即可通过)。
* 不支持 AND 语义:多次调用装饰器会被全局 PermissionGuard 合并为扁平数组,效果等同于单次多参数调用
*/
export const RequirePermission = (...permissions: string[]) =>
SetMetadata(PERMISSION_KEY, permissions);