File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export async function loadBuildinMiddlewaire(rpc?) {
29
29
}
30
30
31
31
export async function loadMiddleware ( rpc , lifeCycle , mw ) {
32
- console . dir ( lifeCycle ) ;
33
- console . dir ( mw ) ;
32
+ log ( lifeCycle ) ;
33
+ log ( mw ) ;
34
34
rpc . config . hooks [ lifeCycle ] . push ( mw ) ;
35
35
}
Original file line number Diff line number Diff line change
1
+ import koajwt from 'koa-jwt' ;
2
+
1
3
export const jwt = {
2
4
name : 'jwt' ,
3
5
lifeCycle : 'load' ,
4
- mw : async ( ctx : any , next : any ) => {
5
- await next ( ) ;
6
+ mw : ( opts ) => {
7
+ // console.dir(opts);
8
+ return koajwt ( opts ) ;
6
9
} ,
7
10
} ;
Original file line number Diff line number Diff line change @@ -151,8 +151,6 @@ export const createServer = function (config?: any) {
151
151
const key = ctx . path . replace ( '/' , '' ) . split ( '/' ) . join ( '.' ) ;
152
152
_cfg . beforeOne ( ctx , key ) ;
153
153
154
- console . dir ( ctx . jwt ) ;
155
-
156
154
const lastKey = key . split ( '.' ) . pop ( ) ;
157
155
const httpMethods = getHttpMethods ( ) ;
158
156
You can’t perform that action at this time.
0 commit comments