|
@@ -26,10 +26,13 @@ class Login extends Admin {
|
|
|
// 验证
|
|
|
if( !$username || !$code ) return json_send(['code'=>'error','msg'=>'用户名验证码必填']);
|
|
|
// 查询用户
|
|
|
- $uid = $AdminUser->orWhere('username',$username)->orWhere('phone',$username)->value('uid');
|
|
|
+ $admin = $AdminUser->orWhere('username',$username)->orWhere('phone',$username)->first(['uid','username','phone','status','password','insert_time','update_time']);
|
|
|
+ // 用户不存在
|
|
|
+ if( !$admin ) return json_send(['code'=>'error','msg'=>'用户名不存在或已被停用']);
|
|
|
+ // 用户不存在
|
|
|
+ if( $admin['status'] ) return json_send(['code'=>'error','msg'=>'用户名不存在或已被停用']);
|
|
|
// 获取数据
|
|
|
- $admin = $AdminUser->getOne($uid);
|
|
|
- $adminRule = $AdminRule::query()->where('admin_uid',$uid)->first();
|
|
|
+ $adminRule = $AdminRule::query()->where('admin_uid',$admin['uid'])->first();
|
|
|
// 用户不存在
|
|
|
if( !$admin || $admin['status'] ) return json_send(['code'=>'error','msg'=>'用户名不存在或已被停用']);
|
|
|
// 比对密码
|