feat : login wx

This commit is contained in:
2024-11-11 17:04:10 +08:00
parent 83a38d5001
commit 3a5739ee19
20 changed files with 844 additions and 4 deletions

View File

@@ -0,0 +1,52 @@
<?php
/**
* This service file is part of item.
*
* @author ctexthuang
* @contact ctexthuang@qq.com
*/
declare(strict_types=1);
namespace App\Service\Api;
use App\Lib\ApiReturn;
use Hyperf\Context\Context;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Contract\RequestInterface;
abstract class BaseService
{
/**
* 请求对象
* @var RequestInterface
*/
#[Inject]
protected RequestInterface $request;
/**
* 通用返回对象
* @var ApiReturn $return
*/
#[Inject]
protected ApiReturn $return;
/**
* 用户id
* @var int $userId
*/
protected int $userId = 0;
/**
* 主构造函数(获取请求对象)
*/
public function __construct()
{
$this->userId = Context::get("user_id",0);
}
/**
* 主体函数抽象类
*/
abstract public function handle();
}