diff --git a/packages/actions/src/actions/index.ts b/packages/actions/src/actions/index.ts index 493d5db5e..c31b38ba9 100644 --- a/packages/actions/src/actions/index.ts +++ b/packages/actions/src/actions/index.ts @@ -7,6 +7,7 @@ export type Next = () => Promise; export interface Context extends Koa.Context { db: Database; action: Action; + body: any; }; export { default as common } from './common'; diff --git a/packages/plugin-permissions/src/actions/roles.collections.ts b/packages/plugin-permissions/src/actions/roles.collections.ts index 3c732586c..281d177b7 100644 --- a/packages/plugin-permissions/src/actions/roles.collections.ts +++ b/packages/plugin-permissions/src/actions/roles.collections.ts @@ -10,7 +10,7 @@ export async function list(ctx: actions.Context, next: actions.Next) { }); await actions.common.list(ctx, async () => { const permissions = await associated.getPermissions(); - (ctx.body.rows as any).forEach(item => { + ctx.body.rows.forEach(item => { const permission = permissions.find(p => p.collection_name === item.get('name')); if (permission) { // item.permissions = [permission]; // 不输出