feat : wx login

This commit is contained in:
2024-11-29 16:36:47 +08:00
parent 237fed9fe6
commit 43353d38b5
2 changed files with 4 additions and 56 deletions

View File

@@ -20,12 +20,15 @@ use App\Lib\Crypto\CryptoFactory;
use App\Model\User;
use App\Model\UserThird;
use App\Service\Api\BaseService;
use App\Service\ServiceTrait\Api\GetUserInfoTrait;
use Hyperf\Di\Annotation\Inject;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
abstract class LoginBaseService extends BaseService
{
use GetUserInfoTrait;
/**
* 注入缓存类
* @var RedisCache
@@ -89,7 +92,7 @@ abstract class LoginBaseService extends BaseService
protected function login(): void
{
$this->userId = empty($this->userId) ? $this->userInfo->id : $this->userId;
$this->userInfo = $this->getUserInfo($this->userId);
if (empty($this->userId)) {
throw new ErrException('登录失败');
}