|
|
|
@ -4,6 +4,7 @@ declare (strict_types = 1); |
|
|
|
namespace app\service\user; |
|
|
|
|
|
|
|
|
|
|
|
use app\model\WechatPucode; |
|
|
|
use app\model\WechatUser; |
|
|
|
use app\service\BaseService; |
|
|
|
use fast\FuncException; |
|
|
|
@ -160,6 +161,7 @@ class LoginService extends BaseService |
|
|
|
if ($newPassword != $user['password']) { |
|
|
|
throw new FuncException('账号密码错误'); |
|
|
|
} |
|
|
|
unset($user['password'], $user['salt']); |
|
|
|
return $this->userSuccess($user); |
|
|
|
} else { |
|
|
|
throw new FuncException('账号密码错误'); |
|
|
|
@ -176,6 +178,8 @@ class LoginService extends BaseService |
|
|
|
session('user', $user->toArray()); |
|
|
|
$this->userKeeplogin($user->id,$user->openid,3600 * 24 * 7); |
|
|
|
// $user->visible(['id', 'name', 'logo']); |
|
|
|
$pucode = WechatPucode::where('wechat_user_id', $user->id)->order('id', "DESC")->value('pucode'); |
|
|
|
$user->pucode = $pucode ?? ''; |
|
|
|
return $user->toArray(); |
|
|
|
} |
|
|
|
|
|
|
|
|