File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 LinRouter,
66 getTokens,
77 loginRequired,
8+ adminRequired,
89 Success,
910 refreshTokenRequiredWithUnifyException,
10- Failed
11+ Failed,
12+ logger,
13+ checkUserIsActive
1114} = require ( "lin-mizar" ) ;
1215
1316const {
@@ -33,6 +36,8 @@ user.linPost(
3336 module : "用户" ,
3437 mount : false
3538 } ,
39+ adminRequired ,
40+ logger ( "管理员新建了一个用户" ) ,
3641 async ctx => {
3742 const v = await new RegisterValidator ( ) . validate ( ctx ) ;
3843 await userDao . createUser ( ctx , v ) ;
@@ -53,6 +58,7 @@ user.linPost(
5358 mount : false
5459 } ,
5560 async ctx => {
61+ checkUserIsActive ( ctx . currentUser ) ;
5662 const v = await new LoginValidator ( ) . validate ( ctx ) ;
5763 let user = await ctx . manager . userModel . verify (
5864 v . get ( "body.nickname" ) ,
Original file line number Diff line number Diff line change 3939 "@koa/cors" : " ^2.2.3" ,
4040 "koa" : " ^2.7.0" ,
4141 "koa-bodyparser" : " ^4.2.1" ,
42- "lin-mizar" : " ^0.0.1-alpha.16 "
42+ "lin-mizar" : " ^0.0.1-alpha.17 "
4343 }
4444}
You can’t perform that action at this time.
0 commit comments