feat : coupon
This commit is contained in:
@@ -97,6 +97,11 @@ abstract class LoginBaseService extends BaseService
|
||||
*/
|
||||
protected string $unionId = '';
|
||||
|
||||
/**
|
||||
* @var int 是否新人弹窗
|
||||
*/
|
||||
protected int $isNewcomerCouponPopUp = 0;
|
||||
|
||||
/**
|
||||
* 登录
|
||||
* @return void
|
||||
@@ -127,6 +132,7 @@ abstract class LoginBaseService extends BaseService
|
||||
'is_bind_mobile' => $this->userInfo->mobile ? UserCode::IS_BIND_PHONE : UserCode::IS_NOT_BIND_PHONE,
|
||||
'nickName' => $this->userInfo->nickName,
|
||||
'is_default_avatar' => $this->userInfo->avatar_id == 0 ? UserCode::IS_DEFAULT_AVATAR : UserCode::IS_NOT_DEFAULT_AVATAR,
|
||||
'is_newcomer_coupon_pop_up' => $this->isNewcomerCouponPopUp,
|
||||
];
|
||||
|
||||
$loginReturn['token'] = $this->cryptoFactory->cryptoClass('jwt', json_encode($loginReturn))->encrypt();
|
||||
@@ -230,6 +236,8 @@ abstract class LoginBaseService extends BaseService
|
||||
if (empty($insertCoupon)) return;
|
||||
|
||||
if (!(new UserCoupon)->insert($insertCoupon)) throw new ErrException('注册失败-00003');
|
||||
|
||||
$this->isNewcomerCouponPopUp = 1;
|
||||
}
|
||||
|
||||
abstract protected function register();
|
||||
|
||||
@@ -17,7 +17,7 @@ class LoginService extends BaseService
|
||||
{
|
||||
protected string $loginType = '';
|
||||
|
||||
public function handle()
|
||||
public function handle(): array
|
||||
{
|
||||
$this->loginType = $this->request->input('login_type','');
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class WxFastLoginService extends LoginBaseService
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws RedisException
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): array
|
||||
{
|
||||
$this->jsCode = $this->request->input('js_code');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user