feat : coupon

This commit is contained in:
2025-02-27 15:45:41 +08:00
parent a843b51768
commit 365eb2b811
3 changed files with 10 additions and 2 deletions

View File

@@ -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();

View File

@@ -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','');

View File

@@ -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');