zxhxx 3 years ago
parent
commit
0ca9616dc2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      application/api/controller/User.php

+ 1 - 1
application/api/controller/User.php

@@ -356,6 +356,7 @@ class User extends Api
             $info['ext'] = $ext->toArray();
         else
             $info['ext'] = null;
+        $info['level_name'] = UserGroup::where('id',$info['level'])->value('name');
         $this->success('获取成功',$info);
     }
     public function setuser(Request $request)
@@ -384,7 +385,6 @@ class User extends Api
         );
         $user = [];$user_ext = [];
         $info = UserModel::find($this->auth->getUserinfo()['id']);
-        $info['level_name'] = UserGroup::where('id',$info['level'])->value('name');
         if($info['user_type']!=0 && $info['user_type']!=$where['user_type']) $this->error('用户类型不可修改');
         if(!preg_match("/^1\d{10}$/", $where['mobile'])) $this->error('手机号不对');
         if(IdentityCard::isValid($where['id_card']))$this->error('身份证号不正确!');