mirror of
https://github.com/certd/certd.git
synced 2026-05-15 12:37:30 +08:00
chore: 增加流水线,授权等文档
This commit is contained in:
@@ -93,7 +93,7 @@ export class AuthorityMiddleware implements IWebMiddleware {
|
||||
await next();
|
||||
return;
|
||||
} else if (openKey.scope === 'open') {
|
||||
return this.notAuth(ctx);
|
||||
return this.notAuth(ctx, 'open key scope error,need user scope');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,9 +113,13 @@ export class AuthorityMiddleware implements IWebMiddleware {
|
||||
};
|
||||
}
|
||||
|
||||
private notAuth(ctx: IMidwayKoaContext) {
|
||||
private notAuth(ctx: IMidwayKoaContext, message?: string) {
|
||||
ctx.status = 401;
|
||||
ctx.body = Constants.res.auth;
|
||||
if (message) {
|
||||
// @ts-ignore
|
||||
ctx.body.message =message;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user