think \ exception \ HttpException
controller not exists:list_156_1.htmljavascript:; think\exception\HttpException thrown with message "controller not exists:list_156_1.htmljavascript:;" Stacktrace: #30 think\exception\HttpException in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/route/dispatch/Url.php:62 #29 think\route\dispatch\Url:parseUrl in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/route/dispatch/Url.php:31 #28 think\route\dispatch\Url:__construct in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Route.php:857 #27 think\Route:url in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Route.php:815 #26 think\Route:check in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Route.php:775 #25 think\Route:dispatch in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Http.php:216 #24 think\Http:dispatchToRoute in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Http.php:206 #23 think\Http:think\{closure} in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Pipeline.php:59 #22 think\Pipeline:think\{closure} in /www/wwwroot/lvzheoa5/vendor/topthink/think-multi-app/src/MultiApp.php:71 #21 think\app\MultiApp:think\app\{closure} in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Pipeline.php:59 #20 think\Pipeline:think\{closure} in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Pipeline.php:66 #19 think\Pipeline:then in /www/wwwroot/lvzheoa5/vendor/topthink/think-multi-app/src/MultiApp.php:72 #18 think\app\MultiApp:handle in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Middleware.php:142 #17 call_user_func in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Middleware.php:142 #16 think\Middleware:think\{closure} in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Pipeline.php:85 #15 think\Pipeline:think\{closure} in /www/wwwroot/lvzheoa5/app/common/middleware/AllowCrossDomain.php:65 #14 app\common\middleware\AllowCrossDomain:handle in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Middleware.php:142 #13 call_user_func in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Middleware.php:142 #12 think\Middleware:think\{closure} in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Pipeline.php:85 #11 think\Pipeline:think\{closure} in /www/wwwroot/lvzheoa5/vendor/thans/tp-jwt-auth/src/middleware/InjectJwt.php:14 #10 thans\jwt\middleware\InjectJwt:handle in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Middleware.php:142 #9 call_user_func in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Middleware.php:142 #8 think\Middleware:think\{closure} in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Pipeline.php:85 #7 think\Pipeline:think\{closure} in /www/wwwroot/lvzheoa5/vendor/topthink/think-trace/src/TraceDebug.php:71 #6 think\trace\TraceDebug:handle in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Middleware.php:142 #5 call_user_func in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Middleware.php:142 #4 think\Middleware:think\{closure} in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Pipeline.php:85 #3 think\Pipeline:think\{closure} in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Pipeline.php:66 #2 think\Pipeline:then in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Http.php:207 #1 think\Http:runWithRequest in /www/wwwroot/lvzheoa5/vendor/topthink/framework/src/think/Http.php:170 #0 think\Http:run in /www/wwwroot/lvzheoa5/public/index.php:29
Stack frames (31)
30
think\exception\HttpException
/vendor/topthink/framework/src/think/route/dispatch/Url.php62
29
think\route\dispatch\Url parseUrl
/vendor/topthink/framework/src/think/route/dispatch/Url.php31
28
think\route\dispatch\Url __construct
/vendor/topthink/framework/src/think/Route.php857
27
think\Route url
/vendor/topthink/framework/src/think/Route.php815
26
think\Route check
/vendor/topthink/framework/src/think/Route.php775
25
think\Route dispatch
/vendor/topthink/framework/src/think/Http.php216
24
think\Http dispatchToRoute
/vendor/topthink/framework/src/think/Http.php206
23
think\Http think\{closure}
/vendor/topthink/framework/src/think/Pipeline.php59
22
think\Pipeline think\{closure}
/vendor/topthink/think-multi-app/src/MultiApp.php71
21
think\app\MultiApp think\app\{closure}
/vendor/topthink/framework/src/think/Pipeline.php59
20
think\Pipeline think\{closure}
/vendor/topthink/framework/src/think/Pipeline.php66
19
think\Pipeline then
/vendor/topthink/think-multi-app/src/MultiApp.php72
18
think\app\MultiApp handle
/vendor/topthink/framework/src/think/Middleware.php142
17
call_user_func
/vendor/topthink/framework/src/think/Middleware.php142
16
think\Middleware think\{closure}
/vendor/topthink/framework/src/think/Pipeline.php85
15
think\Pipeline think\{closure}
/app/common/middleware/AllowCrossDomain.php65
14
app\common\middleware\AllowCrossDomain handle
/vendor/topthink/framework/src/think/Middleware.php142
13
call_user_func
/vendor/topthink/framework/src/think/Middleware.php142
12
think\Middleware think\{closure}
/vendor/topthink/framework/src/think/Pipeline.php85
11
think\Pipeline think\{closure}
/vendor/thans/tp-jwt-auth/src/middleware/InjectJwt.php14
10
thans\jwt\middleware\InjectJwt handle
/vendor/topthink/framework/src/think/Middleware.php142
9
call_user_func
/vendor/topthink/framework/src/think/Middleware.php142
8
think\Middleware think\{closure}
/vendor/topthink/framework/src/think/Pipeline.php85
7
think\Pipeline think\{closure}
/vendor/topthink/think-trace/src/TraceDebug.php71
6
think\trace\TraceDebug handle
/vendor/topthink/framework/src/think/Middleware.php142
5
call_user_func
/vendor/topthink/framework/src/think/Middleware.php142
4
think\Middleware think\{closure}
/vendor/topthink/framework/src/think/Pipeline.php85
3
think\Pipeline think\{closure}
/vendor/topthink/framework/src/think/Pipeline.php66
2
think\Pipeline then
/vendor/topthink/framework/src/think/Http.php207
1
think\Http runWithRequest
/vendor/topthink/framework/src/think/Http.php170
0
think\Http run
/public/index.php29
    {
        $depr = $this->rule->config('pathinfo_depr');
        $bind = $this->rule->getRouter()->getDomainBind();
 
        if ($bind && preg_match('/^[a-z]/is', $bind)) {
            $bind = str_replace('/', $depr, $bind);
            // 如果有域名绑定
            $url = $bind . ('.' != substr($bind, -1) ? $depr : '') . ltrim($url, $depr);
        }
 
        $path = $this->rule->parseUrlPath($url);
        if (empty($path)) {
            return [null, null];
        }
 
        // 解析控制器
        $controller = !empty($path) ? array_shift($path) : null;
 
        if ($controller && !preg_match('/^[A-Za-z0-9][\w|\.]*$/', $controller)) {
            throw new HttpException(404, 'controller not exists:' . $controller);
        }
 
        // 解析操作
        $action = !empty($path) ? array_shift($path) : null;
        $var    = [];
 
        // 解析额外参数
        if ($path) {
            preg_replace_callback('/(\w+)\|([^\|]+)/', function ($match) use (&$var) {
                $var[$match[1]] = strip_tags($match[2]);
            }, implode('|', $path));
        }
 
        $panDomain = $this->request->panDomain();
        if ($panDomain && $key = array_search('*', $var)) {
            // 泛域名赋值
            $var[$key] = $panDomain;
        }
 
        // 设置当前请求的参数
Arguments
  1. "controller not exists:list_156_1.htmljavascript:;"
    
 
namespace think\route\dispatch;
 
use think\exception\HttpException;
use think\helper\Str;
use think\Request;
use think\route\Rule;
 
/**
 * Url Dispatcher
 */
class Url extends Controller
{
 
    public function __construct(Request $request, Rule $rule, $dispatch)
    {
        $this->request = $request;
        $this->rule    = $rule;
        // 解析默认的URL规则
        $dispatch = $this->parseUrl($dispatch);
 
        parent::__construct($request, $rule, $dispatch, $this->param);
    }
 
    /**
     * 解析URL地址
     * @access protected
     * @param  string $url URL
     * @return array
     */
    protected function parseUrl(string $url): array
    {
        $depr = $this->rule->config('pathinfo_depr');
        $bind = $this->rule->getRouter()->getDomainBind();
 
        if ($bind && preg_match('/^[a-z]/is', $bind)) {
            $bind = str_replace('/', $depr, $bind);
            // 如果有域名绑定
            $url = $bind . ('.' != substr($bind, -1) ? $depr : '') . ltrim($url, $depr);
        }
Arguments
  1. "list_156_1.htmljavascript:;"
    
 
        return $path;
    }
 
    /**
     * 默认URL解析
     * @access public
     * @param string $url URL地址
     * @return Dispatch
     */
    public function url(string $url): Dispatch
    {
        if ($this->request->method() == 'OPTIONS') {
            // 自动响应options请求
            return new Callback($this->request, $this->group, function () {
                return Response::create('', 'html', 204)->header(['Allow' => 'GET, POST, PUT, DELETE']);
            });
        }
 
        return new UrlDispatch($this->request, $this->group, $url);
    }
 
    /**
     * 检测域名的路由规则
     * @access protected
     * @return Domain
     */
    protected function checkDomain(): Domain
    {
        $item = false;
 
        if (count($this->domains) > 1) {
            // 获取当前子域名
            $subDomain = $this->request->subDomain();
 
            $domain  = $subDomain ? explode('.', $subDomain) : [];
            $domain2 = $domain ? array_pop($domain) : '';
 
            if ($domain) {
                // 存在三级域名
Arguments
  1. app\Request {#54}
    
  2. think\route\Domain {#95}
    
  3. "list_156_1.htmljavascript:;"
    
    {
        // 自动检测域名路由
        $url = str_replace($this->config['pathinfo_depr'], '|', $this->path());
 
        $completeMatch = $this->config['route_complete_match'];
 
        $result = $this->checkDomain()->check($this->request, $url, $completeMatch);
 
        if (false === $result && !empty($this->cross)) {
            // 检测跨域路由
            $result = $this->cross->check($this->request, $url, $completeMatch);
        }
 
        if (false !== $result) {
            return $result;
        } elseif ($this->config['url_route_must']) {
            throw new RouteNotFoundException();
        }
 
        return $this->url($url);
    }
 
    /**
     * 获取当前请求URL的pathinfo信息(不含URL后缀)
     * @access protected
     * @return string
     */
    protected function path(): string
    {
        $suffix   = $this->config['url_html_suffix'];
        $pathinfo = $this->request->pathinfo();
 
        if (false === $suffix) {
            // 禁止伪静态访问
            $path = $pathinfo;
        } elseif ($suffix) {
            // 去除正常的URL后缀
            $path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo);
        } else {
            // 允许任何后缀访问
Arguments
  1. "list_156_1.htmljavascript:;"
    
        return $this->group->miss($route, $method);
    }
 
    /**
     * 路由调度
     * @param Request $request
     * @param Closure|bool $withRoute
     * @return Response
     */
    public function dispatch(Request $request, $withRoute = true)
    {
        $this->request = $request;
        $this->host    = $this->request->host(true);
 
        if ($withRoute) {
            //加载路由
            if ($withRoute instanceof Closure) {
                $withRoute();
            }
            $dispatch = $this->check();
        } else {
            $dispatch = $this->url($this->path());
        }
 
        $dispatch->init($this->app);
 
        return $this->app->middleware->pipeline('route')
            ->send($request)
            ->then(function () use ($dispatch) {
                return $dispatch->run();
            });
    }
 
    /**
     * 检测URL路由
     * @access public
     * @return Dispatch|false
     * @throws RouteNotFoundException
     */
    public function check()
        // 加载全局中间件
        $this->loadMiddleware();
 
        // 监听HttpRun
        $this->app->event->trigger(HttpRun::class);
 
        return $this->app->middleware->pipeline()
            ->send($request)
            ->then(function ($request) {
                return $this->dispatchToRoute($request);
            });
    }
 
    protected function dispatchToRoute($request)
    {
        $withRoute = $this->app->config->get('app.with_route', true) ? function () {
            $this->loadRoutes();
        } : null;
 
        return $this->app->route->dispatch($request, $withRoute);
    }
 
    /**
     * 加载全局中间件
     */
    protected function loadMiddleware(): void
    {
        if (is_file($this->app->getBasePath() . 'middleware.php')) {
            $this->app->middleware->import(include $this->app->getBasePath() . 'middleware.php');
        }
    }
 
    /**
     * 加载路由
     * @access protected
     * @return void
     */
    protected function loadRoutes(): void
    {
        // 加载路由定义
Arguments
  1. app\Request {#54}
    
  2. Closure() {#83 …4}
    
        }
    }
 
    /**
     * 执行应用程序
     * @param Request $request
     * @return mixed
     */
    protected function runWithRequest(Request $request)
    {
        // 加载全局中间件
        $this->loadMiddleware();
 
        // 监听HttpRun
        $this->app->event->trigger(HttpRun::class);
 
        return $this->app->middleware->pipeline()
            ->send($request)
            ->then(function ($request) {
                return $this->dispatchToRoute($request);
            });
    }
 
    protected function dispatchToRoute($request)
    {
        $withRoute = $this->app->config->get('app.with_route', true) ? function () {
            $this->loadRoutes();
        } : null;
 
        return $this->app->route->dispatch($request, $withRoute);
    }
 
    /**
     * 加载全局中间件
     */
    protected function loadMiddleware(): void
    {
        if (is_file($this->app->getBasePath() . 'middleware.php')) {
            $this->app->middleware->import(include $this->app->getBasePath() . 'middleware.php');
        }
Arguments
  1. app\Request {#54}
    
     */
    public function through($pipes)
    {
        $this->pipes = is_array($pipes) ? $pipes : func_get_args();
        return $this;
    }
 
    /**
     * 执行
     * @param Closure $destination
     * @return mixed
     */
    public function then(Closure $destination)
    {
        $pipeline = array_reduce(
            array_reverse($this->pipes),
            $this->carry(),
            function ($passable) use ($destination) {
                try {
                    return $destination($passable);
                } catch (Throwable | Exception $e) {
                    return $this->handleException($passable, $e);
                }
            }
        );
 
        return $pipeline($this->passable);
    }
 
    /**
     * 设置异常处理器
     * @param callable $handler
     * @return $this
     */
    public function whenException($handler)
    {
        $this->exceptionHandler = $handler;
        return $this;
    }
 
Arguments
  1. app\Request {#54}
    
        $this->path = $this->app->http->getPath();
    }
 
    /**
     * 多应用解析
     * @access public
     * @param Request $request
     * @param Closure $next
     * @return Response
     */
    public function handle($request, Closure $next)
    {
        if (!$this->parseMultiApp()) {
            return $next($request);
        }
 
        return $this->app->middleware->pipeline('app')
            ->send($request)
            ->then(function ($request) use ($next) {
                return $next($request);
            });
    }
 
    /**
     * 获取路由目录
     * @access protected
     * @return string
     */
    protected function getRoutePath(): string
    {
        return $this->app->getAppPath() . 'route' . DIRECTORY_SEPARATOR;
    }
 
    /**
     * 解析多应用
     * @return bool
     */
    protected function parseMultiApp(): bool
    {
        $scriptName = $this->getScriptName();
Arguments
  1. app\Request {#54}
    
     */
    public function through($pipes)
    {
        $this->pipes = is_array($pipes) ? $pipes : func_get_args();
        return $this;
    }
 
    /**
     * 执行
     * @param Closure $destination
     * @return mixed
     */
    public function then(Closure $destination)
    {
        $pipeline = array_reduce(
            array_reverse($this->pipes),
            $this->carry(),
            function ($passable) use ($destination) {
                try {
                    return $destination($passable);
                } catch (Throwable | Exception $e) {
                    return $this->handleException($passable, $e);
                }
            }
        );
 
        return $pipeline($this->passable);
    }
 
    /**
     * 设置异常处理器
     * @param callable $handler
     * @return $this
     */
    public function whenException($handler)
    {
        $this->exceptionHandler = $handler;
        return $this;
    }
 
Arguments
  1. app\Request {#54}
    
    /**
     * 执行
     * @param Closure $destination
     * @return mixed
     */
    public function then(Closure $destination)
    {
        $pipeline = array_reduce(
            array_reverse($this->pipes),
            $this->carry(),
            function ($passable) use ($destination) {
                try {
                    return $destination($passable);
                } catch (Throwable | Exception $e) {
                    return $this->handleException($passable, $e);
                }
            }
        );
 
        return $pipeline($this->passable);
    }
 
    /**
     * 设置异常处理器
     * @param callable $handler
     * @return $this
     */
    public function whenException($handler)
    {
        $this->exceptionHandler = $handler;
        return $this;
    }
 
    protected function carry()
    {
        return function ($stack, $pipe) {
            return function ($passable) use ($stack, $pipe) {
                try {
                    return $pipe($passable, $stack);
                } catch (Throwable | Exception $e) {
Arguments
  1. app\Request {#54}
    
    }
 
    /**
     * 多应用解析
     * @access public
     * @param Request $request
     * @param Closure $next
     * @return Response
     */
    public function handle($request, Closure $next)
    {
        if (!$this->parseMultiApp()) {
            return $next($request);
        }
 
        return $this->app->middleware->pipeline('app')
            ->send($request)
            ->then(function ($request) use ($next) {
                return $next($request);
            });
    }
 
    /**
     * 获取路由目录
     * @access protected
     * @return string
     */
    protected function getRoutePath(): string
    {
        return $this->app->getAppPath() . 'route' . DIRECTORY_SEPARATOR;
    }
 
    /**
     * 解析多应用
     * @return bool
     */
    protected function parseMultiApp(): bool
    {
        $scriptName = $this->getScriptName();
        $defaultApp = $this->app->config->get('app.default_app') ?: 'index';
Arguments
  1. Closure($request) {#82 …4}
    
    {
        return $this->queue[$type] ?? [];
    }
 
    /**
     * 调度管道
     * @access public
     * @param string $type 中间件类型
     * @return Pipeline
     */
    public function pipeline(string $type = 'global')
    {
        return (new Pipeline())
            ->through(array_map(function ($middleware) {
                return function ($request, $next) use ($middleware) {
                    [$call, $params] = $middleware;
                    if (is_array($call) && is_string($call[0])) {
                        $call = [$this->app->make($call[0]), $call[1]];
                    }
                    $response = call_user_func($call, $request, $next, ...$params);
 
                    if (!$response instanceof Response) {
                        throw new LogicException('The middleware must return Response instance');
                    }
                    return $response;
                };
            }, $this->sortMiddleware($this->queue[$type] ?? [])))
            ->whenException([$this, 'handleException']);
    }
 
    /**
     * 结束调度
     * @param Response $response
     */
    public function end(Response $response)
    {
        foreach ($this->queue as $queue) {
            foreach ($queue as $middleware) {
                [$call] = $middleware;
                if (is_array($call) && is_string($call[0])) {
Arguments
  1. app\Request {#54}
    
  2. Closure($passable) {#59 …4}
    
    {
        return $this->queue[$type] ?? [];
    }
 
    /**
     * 调度管道
     * @access public
     * @param string $type 中间件类型
     * @return Pipeline
     */
    public function pipeline(string $type = 'global')
    {
        return (new Pipeline())
            ->through(array_map(function ($middleware) {
                return function ($request, $next) use ($middleware) {
                    [$call, $params] = $middleware;
                    if (is_array($call) && is_string($call[0])) {
                        $call = [$this->app->make($call[0]), $call[1]];
                    }
                    $response = call_user_func($call, $request, $next, ...$params);
 
                    if (!$response instanceof Response) {
                        throw new LogicException('The middleware must return Response instance');
                    }
                    return $response;
                };
            }, $this->sortMiddleware($this->queue[$type] ?? [])))
            ->whenException([$this, 'handleException']);
    }
 
    /**
     * 结束调度
     * @param Response $response
     */
    public function end(Response $response)
    {
        foreach ($this->queue as $queue) {
            foreach ($queue as $middleware) {
                [$call] = $middleware;
                if (is_array($call) && is_string($call[0])) {
Arguments
  1. array:2 [
      0 => think\app\MultiApp {#86}
      1 => "handle"
    ]
    
  2. app\Request {#54}
    
  3. Closure($passable) {#59 …4}
    
        return $pipeline($this->passable);
    }
 
    /**
     * 设置异常处理器
     * @param callable $handler
     * @return $this
     */
    public function whenException($handler)
    {
        $this->exceptionHandler = $handler;
        return $this;
    }
 
    protected function carry()
    {
        return function ($stack, $pipe) {
            return function ($passable) use ($stack, $pipe) {
                try {
                    return $pipe($passable, $stack);
                } catch (Throwable | Exception $e) {
                    return $this->handleException($passable, $e);
                }
            };
        };
    }
 
    /**
     * 异常处理
     * @param $passable
     * @param $e
     * @return mixed
     */
    protected function handleException($passable, Throwable $e)
    {
        if ($this->exceptionHandler) {
            return call_user_func($this->exceptionHandler, $passable, $e);
        }
        throw $e;
    }
Arguments
  1. app\Request {#54}
    
  2. Closure($passable) {#59 …4}
    
     */
    public function handle($request, Closure $next, ? array $header = [])
    {
        $header = !empty($header) ? array_merge($this->header, $header) : $this->header;
        if($request->server('REQUEST_METHOD') == 'OPTIONS'){
            header('DAV: 1, 2, 3, extended-lvzhe');
            header('MS-Author-Via: DAV');
            header('Accept-Ranges: bytes');
            header('Content-Length: 0');
        }
        if (!isset($header['Access-Control-Allow-Origin'])) {
            $origin = $request->header('origin');

            if ($origin && ('' == $this->cookieDomain || strpos($origin, $this->cookieDomain))) {
                $header['Access-Control-Allow-Origin'] = $origin;
            } else {
                $header['Access-Control-Allow-Origin'] = '*';
            }
        }
        return $next($request)->header($header);
    }
}
 
Arguments
  1. app\Request {#54}
    
    {
        return $this->queue[$type] ?? [];
    }
 
    /**
     * 调度管道
     * @access public
     * @param string $type 中间件类型
     * @return Pipeline
     */
    public function pipeline(string $type = 'global')
    {
        return (new Pipeline())
            ->through(array_map(function ($middleware) {
                return function ($request, $next) use ($middleware) {
                    [$call, $params] = $middleware;
                    if (is_array($call) && is_string($call[0])) {
                        $call = [$this->app->make($call[0]), $call[1]];
                    }
                    $response = call_user_func($call, $request, $next, ...$params);
 
                    if (!$response instanceof Response) {
                        throw new LogicException('The middleware must return Response instance');
                    }
                    return $response;
                };
            }, $this->sortMiddleware($this->queue[$type] ?? [])))
            ->whenException([$this, 'handleException']);
    }
 
    /**
     * 结束调度
     * @param Response $response
     */
    public function end(Response $response)
    {
        foreach ($this->queue as $queue) {
            foreach ($queue as $middleware) {
                [$call] = $middleware;
                if (is_array($call) && is_string($call[0])) {
Arguments
  1. app\Request {#54}
    
  2. Closure($passable) {#60 …4}
    
    {
        return $this->queue[$type] ?? [];
    }
 
    /**
     * 调度管道
     * @access public
     * @param string $type 中间件类型
     * @return Pipeline
     */
    public function pipeline(string $type = 'global')
    {
        return (new Pipeline())
            ->through(array_map(function ($middleware) {
                return function ($request, $next) use ($middleware) {
                    [$call, $params] = $middleware;
                    if (is_array($call) && is_string($call[0])) {
                        $call = [$this->app->make($call[0]), $call[1]];
                    }
                    $response = call_user_func($call, $request, $next, ...$params);
 
                    if (!$response instanceof Response) {
                        throw new LogicException('The middleware must return Response instance');
                    }
                    return $response;
                };
            }, $this->sortMiddleware($this->queue[$type] ?? [])))
            ->whenException([$this, 'handleException']);
    }
 
    /**
     * 结束调度
     * @param Response $response
     */
    public function end(Response $response)
    {
        foreach ($this->queue as $queue) {
            foreach ($queue as $middleware) {
                [$call] = $middleware;
                if (is_array($call) && is_string($call[0])) {
Arguments
  1. array:2 [
      0 => app\common\middleware\AllowCrossDomain {#87}
      1 => "handle"
    ]
    
  2. app\Request {#54}
    
  3. Closure($passable) {#60 …4}
    
        return $pipeline($this->passable);
    }
 
    /**
     * 设置异常处理器
     * @param callable $handler
     * @return $this
     */
    public function whenException($handler)
    {
        $this->exceptionHandler = $handler;
        return $this;
    }
 
    protected function carry()
    {
        return function ($stack, $pipe) {
            return function ($passable) use ($stack, $pipe) {
                try {
                    return $pipe($passable, $stack);
                } catch (Throwable | Exception $e) {
                    return $this->handleException($passable, $e);
                }
            };
        };
    }
 
    /**
     * 异常处理
     * @param $passable
     * @param $e
     * @return mixed
     */
    protected function handleException($passable, Throwable $e)
    {
        if ($this->exceptionHandler) {
            return call_user_func($this->exceptionHandler, $passable, $e);
        }
        throw $e;
    }
Arguments
  1. app\Request {#54}
    
  2. Closure($passable) {#60 …4}
    
<?php
 
 
namespace thans\jwt\middleware;
 
use think\Request;
use thans\jwt\provider\JWT as JWTProvider;
 
class InjectJwt
{
    public function handle(Request $request, $next)
    {
        (new JWTProvider($request))->init();
        $response = $next($request);
        return $response;
    }
}
 
Arguments
  1. app\Request {#54}
    
    {
        return $this->queue[$type] ?? [];
    }
 
    /**
     * 调度管道
     * @access public
     * @param string $type 中间件类型
     * @return Pipeline
     */
    public function pipeline(string $type = 'global')
    {
        return (new Pipeline())
            ->through(array_map(function ($middleware) {
                return function ($request, $next) use ($middleware) {
                    [$call, $params] = $middleware;
                    if (is_array($call) && is_string($call[0])) {
                        $call = [$this->app->make($call[0]), $call[1]];
                    }
                    $response = call_user_func($call, $request, $next, ...$params);
 
                    if (!$response instanceof Response) {
                        throw new LogicException('The middleware must return Response instance');
                    }
                    return $response;
                };
            }, $this->sortMiddleware($this->queue[$type] ?? [])))
            ->whenException([$this, 'handleException']);
    }
 
    /**
     * 结束调度
     * @param Response $response
     */
    public function end(Response $response)
    {
        foreach ($this->queue as $queue) {
            foreach ($queue as $middleware) {
                [$call] = $middleware;
                if (is_array($call) && is_string($call[0])) {
Arguments
  1. app\Request {#54}
    
  2. Closure($passable) {#61 …4}
    
    {
        return $this->queue[$type] ?? [];
    }
 
    /**
     * 调度管道
     * @access public
     * @param string $type 中间件类型
     * @return Pipeline
     */
    public function pipeline(string $type = 'global')
    {
        return (new Pipeline())
            ->through(array_map(function ($middleware) {
                return function ($request, $next) use ($middleware) {
                    [$call, $params] = $middleware;
                    if (is_array($call) && is_string($call[0])) {
                        $call = [$this->app->make($call[0]), $call[1]];
                    }
                    $response = call_user_func($call, $request, $next, ...$params);
 
                    if (!$response instanceof Response) {
                        throw new LogicException('The middleware must return Response instance');
                    }
                    return $response;
                };
            }, $this->sortMiddleware($this->queue[$type] ?? [])))
            ->whenException([$this, 'handleException']);
    }
 
    /**
     * 结束调度
     * @param Response $response
     */
    public function end(Response $response)
    {
        foreach ($this->queue as $queue) {
            foreach ($queue as $middleware) {
                [$call] = $middleware;
                if (is_array($call) && is_string($call[0])) {
Arguments
  1. array:2 [
      0 => thans\jwt\middleware\InjectJwt {#66}
      1 => "handle"
    ]
    
  2. app\Request {#54}
    
  3. Closure($passable) {#61 …4}
    
        return $pipeline($this->passable);
    }
 
    /**
     * 设置异常处理器
     * @param callable $handler
     * @return $this
     */
    public function whenException($handler)
    {
        $this->exceptionHandler = $handler;
        return $this;
    }
 
    protected function carry()
    {
        return function ($stack, $pipe) {
            return function ($passable) use ($stack, $pipe) {
                try {
                    return $pipe($passable, $stack);
                } catch (Throwable | Exception $e) {
                    return $this->handleException($passable, $e);
                }
            };
        };
    }
 
    /**
     * 异常处理
     * @param $passable
     * @param $e
     * @return mixed
     */
    protected function handleException($passable, Throwable $e)
    {
        if ($this->exceptionHandler) {
            return call_user_func($this->exceptionHandler, $passable, $e);
        }
        throw $e;
    }
Arguments
  1. app\Request {#54}
    
  2. Closure($passable) {#61 …4}
    
     * @access public
     * @param Request $request
     * @param Closure $next
     * @return void
     */
    public function handle($request, Closure $next)
    {
        $debug = $this->app->isDebug();
 
        // 注册日志监听
        if ($debug) {
            $this->log = [];
            $this->app->event->listen(LogWrite::class, function ($event) {
                if (empty($this->config['channel']) || $this->config['channel'] == $event->channel) {
                    $this->log = array_merge_recursive($this->log, $event->log);
                }
            });
        }
 
        $response = $next($request);
 
        // Trace调试注入
        if ($debug) {
            $data = $response->getContent();
            $this->traceDebug($response, $data);
            $response->content($data);
        }
 
        return $response;
    }
 
    public function traceDebug(Response $response, &$content)
    {
        $config = $this->config;
        $type   = $config['type'] ?? 'Html';
 
        unset($config['type']);
 
        $trace = App::factory($type, '\\think\\trace\\', $config);
 
Arguments
  1. app\Request {#54}
    
    {
        return $this->queue[$type] ?? [];
    }
 
    /**
     * 调度管道
     * @access public
     * @param string $type 中间件类型
     * @return Pipeline
     */
    public function pipeline(string $type = 'global')
    {
        return (new Pipeline())
            ->through(array_map(function ($middleware) {
                return function ($request, $next) use ($middleware) {
                    [$call, $params] = $middleware;
                    if (is_array($call) && is_string($call[0])) {
                        $call = [$this->app->make($call[0]), $call[1]];
                    }
                    $response = call_user_func($call, $request, $next, ...$params);
 
                    if (!$response instanceof Response) {
                        throw new LogicException('The middleware must return Response instance');
                    }
                    return $response;
                };
            }, $this->sortMiddleware($this->queue[$type] ?? [])))
            ->whenException([$this, 'handleException']);
    }
 
    /**
     * 结束调度
     * @param Response $response
     */
    public function end(Response $response)
    {
        foreach ($this->queue as $queue) {
            foreach ($queue as $middleware) {
                [$call] = $middleware;
                if (is_array($call) && is_string($call[0])) {
Arguments
  1. app\Request {#54}
    
  2. Closure($passable) {#62 …4}
    
    {
        return $this->queue[$type] ?? [];
    }
 
    /**
     * 调度管道
     * @access public
     * @param string $type 中间件类型
     * @return Pipeline
     */
    public function pipeline(string $type = 'global')
    {
        return (new Pipeline())
            ->through(array_map(function ($middleware) {
                return function ($request, $next) use ($middleware) {
                    [$call, $params] = $middleware;
                    if (is_array($call) && is_string($call[0])) {
                        $call = [$this->app->make($call[0]), $call[1]];
                    }
                    $response = call_user_func($call, $request, $next, ...$params);
 
                    if (!$response instanceof Response) {
                        throw new LogicException('The middleware must return Response instance');
                    }
                    return $response;
                };
            }, $this->sortMiddleware($this->queue[$type] ?? [])))
            ->whenException([$this, 'handleException']);
    }
 
    /**
     * 结束调度
     * @param Response $response
     */
    public function end(Response $response)
    {
        foreach ($this->queue as $queue) {
            foreach ($queue as $middleware) {
                [$call] = $middleware;
                if (is_array($call) && is_string($call[0])) {
Arguments
  1. array:2 [
      0 => think\trace\TraceDebug {#68}
      1 => "handle"
    ]
    
  2. app\Request {#54}
    
  3. Closure($passable) {#62 …4}
    
        return $pipeline($this->passable);
    }
 
    /**
     * 设置异常处理器
     * @param callable $handler
     * @return $this
     */
    public function whenException($handler)
    {
        $this->exceptionHandler = $handler;
        return $this;
    }
 
    protected function carry()
    {
        return function ($stack, $pipe) {
            return function ($passable) use ($stack, $pipe) {
                try {
                    return $pipe($passable, $stack);
                } catch (Throwable | Exception $e) {
                    return $this->handleException($passable, $e);
                }
            };
        };
    }
 
    /**
     * 异常处理
     * @param $passable
     * @param $e
     * @return mixed
     */
    protected function handleException($passable, Throwable $e)
    {
        if ($this->exceptionHandler) {
            return call_user_func($this->exceptionHandler, $passable, $e);
        }
        throw $e;
    }
Arguments
  1. app\Request {#54}
    
  2. Closure($passable) {#62 …4}
    
    /**
     * 执行
     * @param Closure $destination
     * @return mixed
     */
    public function then(Closure $destination)
    {
        $pipeline = array_reduce(
            array_reverse($this->pipes),
            $this->carry(),
            function ($passable) use ($destination) {
                try {
                    return $destination($passable);
                } catch (Throwable | Exception $e) {
                    return $this->handleException($passable, $e);
                }
            }
        );
 
        return $pipeline($this->passable);
    }
 
    /**
     * 设置异常处理器
     * @param callable $handler
     * @return $this
     */
    public function whenException($handler)
    {
        $this->exceptionHandler = $handler;
        return $this;
    }
 
    protected function carry()
    {
        return function ($stack, $pipe) {
            return function ($passable) use ($stack, $pipe) {
                try {
                    return $pipe($passable, $stack);
                } catch (Throwable | Exception $e) {
Arguments
  1. app\Request {#54}
    
    }
 
    /**
     * 执行应用程序
     * @param Request $request
     * @return mixed
     */
    protected function runWithRequest(Request $request)
    {
        // 加载全局中间件
        $this->loadMiddleware();
 
        // 监听HttpRun
        $this->app->event->trigger(HttpRun::class);
 
        return $this->app->middleware->pipeline()
            ->send($request)
            ->then(function ($request) {
                return $this->dispatchToRoute($request);
            });
    }
 
    protected function dispatchToRoute($request)
    {
        $withRoute = $this->app->config->get('app.with_route', true) ? function () {
            $this->loadRoutes();
        } : null;
 
        return $this->app->route->dispatch($request, $withRoute);
    }
 
    /**
     * 加载全局中间件
     */
    protected function loadMiddleware(): void
    {
        if (is_file($this->app->getBasePath() . 'middleware.php')) {
            $this->app->middleware->import(include $this->app->getBasePath() . 'middleware.php');
        }
    }
Arguments
  1. Closure($request) {#34 …4}
    
        return $this->isBind;
    }
 
    /**
     * 执行应用程序
     * @access public
     * @param Request|null $request
     * @return Response
     */
    public function run(Request $request = null): Response
    {
        //初始化
        $this->initialize();
 
        //自动创建request对象
        $request = $request ?? $this->app->make('request', [], true);
        $this->app->instance('request', $request);
 
        try {
            $response = $this->runWithRequest($request);
        } catch (Throwable $e) {
            $this->reportException($e);
 
            $response = $this->renderException($request, $e);
        }
 
        return $response;
    }
 
    /**
     * 初始化
     */
    protected function initialize()
    {
        if (!$this->app->initialized()) {
            $this->app->initialize();
        }
    }
 
    /**
Arguments
  1. app\Request {#54}
    
// +----------------------------------------------------------------------

// [ 应用入口文件 ]
namespace think;

header('Access-Control-Allow-Origin:*');  //  *号代表所有的域名都可以访问,可单独设置请求的域名
// 响应类型
header('Access-Control-Allow-Methods:*');  //  *号代表可以接收所有的请求,可单独设置
// 响应头设置
header('Access-Control-Allow-Headers:x-requested-with,X_Requested_With,content-type');

require __DIR__ . '/../vendor/autoload.php';

define('DS', DIRECTORY_SEPARATOR);
define('UPLOAD_IMAGE',__DIR__.'/../public/file/avatar/');

// 执行HTTP应用并响应
$http = (new App())->http;

$response = $http->run();

$response->send();

$http->end($response);
 

Environment & details:

Key Value
Version
"6.0.14LTS"
URI
"https://www.kaishanlaw.com/list_156_1.htmljavascript:;"
Request URI
"/list_156_1.htmljavascript:;"
Path Info
"list_156_1.htmljavascript:;"
Query String
"s=/list_156_1.htmljavascript:;"
HTTP Method
"GET"
Base URL
"/list_156_1.htmljavascript:;"
Scheme
"https"
Port
443
Host
"www.kaishanlaw.com"
empty
empty
empty
empty
empty
Key Value
USER
"www"
HOME
"/home/www"
HTTP_REFERER
"http://www.kaishanlaw.com/list_156_1.htmljavascript:;"
HTTP_USER_AGENT
"claudebot"
HTTP_ACCEPT
"*/*"
HTTP_HOST
"www.kaishanlaw.com"
PATH_INFO
""
REDIRECT_STATUS
"200"
SERVER_NAME
"www.kaishanlaw.com"
SERVER_PORT
"443"
SERVER_ADDR
"172.17.76.150"
REMOTE_PORT
"45504"
REMOTE_ADDR
"54.198.146.224"
SERVER_SOFTWARE
"nginx/1.20.1"
GATEWAY_INTERFACE
"CGI/1.1"
HTTPS
"on"
REQUEST_SCHEME
"https"
SERVER_PROTOCOL
"HTTP/2.0"
DOCUMENT_ROOT
"/www/wwwroot/lvzheoa5/public"
DOCUMENT_URI
"/index.php"
REQUEST_URI
"/list_156_1.htmljavascript:;"
SCRIPT_NAME
"/index.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
"s=/list_156_1.htmljavascript:;"
SCRIPT_FILENAME
"/www/wwwroot/lvzheoa5/public/index.php"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1711690800.6658
REQUEST_TIME
1711690800
empty
0. Whoops\Handler\PrettyPageHandler