mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2026-01-05 01:48:13 +00:00
11
This commit is contained in:
parent
36bdaf8739
commit
a70aa31fa4
@ -3,7 +3,7 @@ import { ILifeCycle, IMidwayContainer } from '@midwayjs/core';
|
||||
import { Application } from 'egg';
|
||||
import * as orm from '@midwayjs/orm';
|
||||
import * as cool from 'midwayjs-cool-core';
|
||||
import * as redis from 'midwayjs-cool-redis';
|
||||
//import * as redis from 'midwayjs-cool-redis';
|
||||
|
||||
@Configuration({
|
||||
// 注意组件顺序 cool 有依赖orm组件, 所以必须放在,orm组件之后 cool的其他组件必须放在cool 核心组件之后
|
||||
@ -12,7 +12,7 @@ import * as redis from 'midwayjs-cool-redis';
|
||||
orm,
|
||||
// 必须,不可移除, cool-admin 官方组件 https://www.cool-js.com
|
||||
cool,
|
||||
redis
|
||||
//redis
|
||||
|
||||
]
|
||||
})
|
||||
@ -22,7 +22,9 @@ export class ContainerLifeCycle implements ILifeCycle {
|
||||
app: Application;
|
||||
// 应用启动完成
|
||||
async onReady(container?: IMidwayContainer) {
|
||||
//this.app.use(await this.app.generateMiddleware('reportMiddleware'));
|
||||
this.app.use(async (ctx, next)=>{
|
||||
console.log('执行了')
|
||||
});
|
||||
}
|
||||
// 应用停止
|
||||
async onStop() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user