Ver Fonte

中间件bug

lrf há 2 anos atrás
pai
commit
d5c2da6b3f
1 ficheiros alterados com 2 adições e 3 exclusões
  1. 2 3
      src/configuration.ts

+ 2 - 3
src/configuration.ts

@@ -5,7 +5,6 @@ import * as koa from '@midwayjs/koa';
 import * as typegoose from '@midwayjs/typegoose';
 import * as Typegoose from '@typegoose/typegoose';
 import { ResponseMiddleware } from './middleware/response.middleware';
-import { IMidwayApplication, IMidwayContainer } from '@midwayjs/core';
 @Configuration({
   namespace: 'free',
   imports: [koa, typegoose],
@@ -24,9 +23,9 @@ export class FreeConfiguration {
     if (path)
       console.log(`api文档: http://127.0.0.1:${port}${path}/index.html`);
   }
-  async onReady(container: IMidwayContainer, app: IMidwayApplication) {
+  async onReady() {
     // TODO something
-    app.getMiddleware().insertLast(ResponseMiddleware);
+    this.app.getMiddleware().insertLast(ResponseMiddleware);
     Typegoose.setGlobalOptions({
       schemaOptions: {
         id: true,