File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,8 +59,16 @@ class UserDao {
5959 group_id : user . group_id
6060 }
6161 } ) ;
62+ let group = await ctx . manager . groupModel . findOne ( {
63+ where : {
64+ id : user . group_id
65+ }
66+ } )
6267 const aus = this . splitAuths ( auths ) ;
6368 set ( user , 'auths' , aus ) ;
69+ if ( group ) {
70+ set ( user , 'groupName' , group . name ) ;
71+ }
6472 return user ;
6573 }
6674
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ class RegisterValidator extends LinValidator {
66 constructor ( ) {
77 super ( ) ;
88 this . username = [
9- new Rule ( 'isNotEmpty' , '昵称不可为空 ' ) ,
10- new Rule ( 'isLength' , '昵称长度必须在2~10之间 ' , 2 , 10 )
9+ new Rule ( 'isNotEmpty' , '用户名不可为空 ' ) ,
10+ new Rule ( 'isLength' , '用户名长度必须在2~20之间 ' , 2 , 20 )
1111 ] ;
1212 this . group_id = new Rule ( 'isInt' , '分组id必须是整数,且大于0' , {
1313 min : 1
@@ -42,7 +42,7 @@ class RegisterValidator extends LinValidator {
4242class LoginValidator extends LinValidator {
4343 constructor ( ) {
4444 super ( ) ;
45- this . username = new Rule ( 'isNotEmpty' , '昵称不可为空 ' ) ;
45+ this . username = new Rule ( 'isNotEmpty' , '用户名不可为空 ' ) ;
4646 this . password = new Rule ( 'isNotEmpty' , '密码不可为空' ) ;
4747 }
4848}
You can’t perform that action at this time.
0 commit comments