|
@@ -22,13 +22,14 @@ class Login extends Base{
|
|
|
if($valid->check($param)==false)return error($valid->getError());
|
|
|
$info = $this->model->with(['accountItem'=>['itemName'],'company_relaton','userInfo'])->where
|
|
|
(["username"=>$param['username'],"is_del"=>0])->findOrEmpty();
|
|
|
+ $info->hidden(['userInfo','password','salt','accountItem','openId']);
|
|
|
if($info->isEmpty()) return error("账户不存在");
|
|
|
$sha1 = sha1($param['password'] .$info->salt);
|
|
|
if ($sha1 != $info->password) return error("密码错误");
|
|
|
if ($info->status==0) return error("账户已禁用");
|
|
|
$info->system_version = (new AccountPlat())->where(['account_id'=>$info->id])->column('system_version','plat_code');
|
|
|
$token = makeToken($info->username);
|
|
|
- \app\common\User::instance()->LoginUserInfo($info,$token,$this->keepTime);
|
|
|
+ \app\common\User::instance()->LoginUserInfo($info->toArray(),$token,$this->keepTime);
|
|
|
return success("登录成功",$info);
|
|
|
}
|
|
|
}
|