优化注释

This commit is contained in:
evoxwht 2023-04-07 10:58:30 +08:00
parent c7e8182166
commit 37b983619a
5 changed files with 34 additions and 2 deletions

View File

@ -25,9 +25,19 @@ use crmeb\services\CacheService;
*/
class AdminAuthTokenMiddleware implements MiddlewareInterface
{
/**
* @param Request $request
* @param \Closure $next
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 吴汐
* @email 442384644@qq.com
* @date 2023/04/07
*/
public function handle(Request $request, \Closure $next)
{
$authInfo = null;
$token = trim(ltrim($request->header(Config::get('cookie.token_name', 'Authori-zation')), 'Bearer'));
/** @var AdminAuthServices $service */
$service = app()->make(AdminAuthServices::class);

View File

@ -23,6 +23,18 @@ use crmeb\interfaces\MiddlewareInterface;
*/
class AuthTokenMiddleware implements MiddlewareInterface
{
/**
* @param Request $request
* @param \Closure $next
* @param bool $force
* @return int|mixed|\think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 吴汐
* @email 442384644@qq.com
* @date 2023/04/07
*/
public function handle(Request $request, \Closure $next, bool $force = true)
{
$authInfo = null;

View File

@ -21,6 +21,15 @@ use crmeb\interfaces\MiddlewareInterface;
*/
class BaseMiddleware implements MiddlewareInterface
{
/**
* @param Request $request
* @param \Closure $next
* @param bool $force
* @return mixed
* @author 吴汐
* @email 442384644@qq.com
* @date 2023/04/07
*/
public function handle(Request $request, \Closure $next, bool $force = true)
{
if (!$request->hasMacro('uid')) {

View File

@ -27,6 +27,7 @@ class KefuAuthTokenMiddleware implements MiddlewareInterface
/**
* @param Request $request
* @param \Closure $next
* @return mixed
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
@ -34,7 +35,6 @@ class KefuAuthTokenMiddleware implements MiddlewareInterface
*/
public function handle(Request $request, \Closure $next)
{
$authInfo = null;
$token = trim(ltrim($request->header(Config::get('cookie.token_name', 'Authori-zation')), 'Bearer'));
/** @var LoginServices $services */
$services = app()->make(LoginServices::class);

View File

@ -28,6 +28,7 @@ class AuthTokenMiddleware implements MiddlewareInterface
/**
* @param Request $request
* @param \Closure $next
* @return mixed
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException