feat : wx login
This commit is contained in:
@@ -11,19 +11,28 @@ declare(strict_types=1);
|
||||
namespace App\Service\Api\Login;
|
||||
|
||||
use App\Constants\Common\ThirdCode;
|
||||
use App\Event\RegistrationEvent;
|
||||
use App\Exception\ErrException;
|
||||
use App\Model\UserAccount;
|
||||
use App\Model\UserThird;
|
||||
use App\Service\ServiceTrait\Api\WxMiniTrait;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Psr\EventDispatcher\EventDispatcherInterface;
|
||||
use RedisException;
|
||||
|
||||
class WxFastLoginService extends LoginBaseService
|
||||
{
|
||||
use WxMiniTrait;
|
||||
|
||||
/**
|
||||
* @var EventDispatcherInterface
|
||||
*/
|
||||
#[Inject]
|
||||
private EventDispatcherInterface $eventDispatcher;
|
||||
|
||||
/**
|
||||
* 登录类型 2=微信小程序
|
||||
*/
|
||||
@@ -101,8 +110,9 @@ class WxFastLoginService extends LoginBaseService
|
||||
// 邀请过来的 邀请方有没有奖励 被邀请方有没有奖励
|
||||
$this->checkInvite();
|
||||
|
||||
// 有没有注册奖励
|
||||
$this->addCoupon();
|
||||
// 有没有注册奖励 事件机制
|
||||
// $this->addCoupon();
|
||||
$this->eventDispatcher->dispatch(new RegistrationEvent($this->userId));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -12,4 +12,5 @@ declare(strict_types=1);
|
||||
return [
|
||||
Hyperf\ExceptionHandler\Listener\ErrorExceptionHandler::class,
|
||||
Hyperf\Command\Listener\FailToHandleListener::class,
|
||||
App\Listener\FirstRegistrationListener::class,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user