chore: swagger support

This commit is contained in:
xiaojunnuo
2026-03-15 14:01:34 +08:00
parent 8a3841f638
commit 684964da4f
40 changed files with 110 additions and 22 deletions
@@ -128,8 +128,11 @@ export class AuthorityMiddleware implements IWebMiddleware {
//校验 openKey
const openKeyRes = await this.openKeyService.verifyOpenKey(openKey);
const roles = await this.roleService.getRoleIdsByUserId(openKeyRes.userId);
ctx.user = { id: openKeyRes.userId, roles };
let roles = [1]
if (!openKeyRes.projectId || openKeyRes.projectId <= 0) {
roles = await this.roleService.getRoleIdsByUserId(openKeyRes.userId);
}
ctx.user = { id: openKeyRes.userId, roles ,projectId:openKeyRes.projectId};
ctx.openKey = openKeyRes;
return openKeyRes;
}