From 17ae46116365275d8eb971a940383082fab08592 Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 16 Mar 2021 16:58:57 +0800 Subject: [PATCH] fix: Property 'rows' does not exist on type 'unknown'. --- packages/actions/src/actions/index.ts | 1 + packages/plugin-permissions/src/actions/roles.collections.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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]; // 不输出