mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
chore: swagger support
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user