evoxwht 2 лет назад
Родитель
Сommit
37b983619a

+ 11 - 1
crmeb/app/adminapi/middleware/AdminAuthTokenMiddleware.php

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

+ 12 - 0
crmeb/app/api/middleware/AuthTokenMiddleware.php

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

+ 9 - 0
crmeb/app/http/middleware/BaseMiddleware.php

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

+ 1 - 1
crmeb/app/kefuapi/middleware/KefuAuthTokenMiddleware.php

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

+ 1 - 0
crmeb/app/outapi/middleware/AuthTokenMiddleware.php

@@ -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