$param['coor'] = 'bd09ll';
$param['ak'] = $ak;
$res=Request::Get($url, $param);
$arr = json_decode($res);
return ($arr->content->address_detail);
}
}
$param['coor'] = 'bd09ll';
$param['ak'] = $ak;
$res=Request::Get($url, $param);
$arr = json_decode($res);
return ($arr->content->address_detail);
}
}
$ip = Location::getIp();
$province = '接口达到上限';
$city = '需付费';
$arr = ['2fa18d30991049c5'];
//if (in_array($user_id, $arr)) {
$location = Location::getLocationByIp($ip, '');
if($location){
$province = $location->province;
$city = $location->city;
}
//}
} elseif ($column == 'spectrum') {
$column = '谱图';
} else {
$column = '';
}
FootprintServices::getInstance()->Create($user_id, $column, $page_type, $imgs, $title, '', $web_url, $wx_url, '');
$header = ['is_mobile' => $is_mobile, 'title' => $title, 'column' => $column, 'class' => ['goods' => $goods], 'keywords' => $keywords, 'web_url' => $web_url, 'user_id' => $user_id, 'user_info' => $user_info, 'user' => $user_info];
return (object)$header;
}
}
$info = $this->getInfoByQuestionId($question_id, $model);
$info->invite = UserServices::getInstance()->getInviteByQuestionId($question_id);
$answer_list = AnswerServices::getInstance()->getAnswerListByQuestionId($question_id, null);
$newest = $this->getNewest('', 6);
$header = HeaderServices::getInstance()->header('', '问题页', '', @$info->question_name, '');
return view('ask.question.info', compact('header', 'info', 'answer_list', 'question_id', 'newest'));
}
public function getIndex($cat, $class_id): Paginator
{
return QuestionServices::getInstance()->ask($request);
}
public function Info($question_id, AskQuestionInfo $model)
{
return QuestionServices::getInstance()->info($question_id, $model);
}
}
if (method_exists($controller, 'callAction')) {
return $controller->callAction($method, $parameters);
}
return $controller->{$method}(...array_values($parameters));
}
/**
* Get the middleware for the controller instance.
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
protected function runController()
{
return $this->controllerDispatcher()->dispatch(
$this, $this->getController(), $this->getControllerMethod()
);
}
/**
* Get the controller instance for the route.
{
$this->container = $this->container ?: new Container;
try {
if ($this->isControllerAction()) {
return $this->runController();
}
return $this->runCallable();
} catch (HttpResponseException $e) {
return $e->getResponse();
return (new Pipeline($this->container))
->send($request)
->through($middleware)
->then(function ($request) use ($route) {
return $this->prepareResponse(
$request, $route->run()
);
});
}
/**
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
try {
return $destination($passable);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
}
{
$this->router->substituteBindings($route = $request->route());
$this->router->substituteImplicitBindings($route);
return $next($request);
}
}
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
// Putting the errors in the view for every view allows the developer to just
// assume that some errors are always available, which is convenient since
// they don't have to continually run checks for the presence of errors.
return $next($request);
}
}
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
$this->startSession($request, $session)
);
$this->collectGarbage($session);
$response = $next($request);
$this->storeCurrentUrl($request, $session);
$this->addCookieToResponse($response, $session);
if ($this->manager->shouldBlock() ||
($request->route() && $request->route()->locksFor())) {
return $this->handleRequestWhileBlocking($request, $session, $next);
} else {
return $this->handleStatefulRequest($request, $session, $next);
}
}
/**
* Handle the given request within session state.
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$response = $next($request);
foreach ($this->cookies->getQueuedCookies() as $cookie) {
$response->headers->setCookie($cookie);
}
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
* @param \Closure $next
* @return \Symfony\Component\HttpFoundation\Response
*/
public function handle($request, Closure $next)
{
return $this->encrypt($next($this->decrypt($request)));
}
/**
* Decrypt the cookies on the request.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
{
$pipeline = array_reduce(
array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
->through($middleware)
->then(function ($request) use ($route) {
return $this->prepareResponse(
$request, $route->run()
);
});
}
/**
* Gather the middleware for the given route with resolved class names.
*
});
$this->events->dispatch(new RouteMatched($route, $request));
return $this->prepareResponse($request,
$this->runRouteWithinStack($route, $request)
);
}
/**
* Run the given route within a Stack "onion" instance.
* @param \Illuminate\Http\Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function dispatchToRoute(Request $request)
{
return $this->runRoute($request, $this->findRoute($request));
}
/**
* Find the route matching a given request.
*
*/
public function dispatch(Request $request)
{
$this->currentRequest = $request;
return $this->dispatchToRoute($request);
}
/**
* Dispatch the request to a route and return the response.
*
protected function dispatchToRouter()
{
return function ($request) {
$this->app->instance('request', $request);
return $this->router->dispatch($request);
};
}
/**
* Call the terminate method on any terminable middleware.
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
try {
return $destination($passable);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
}
*/
public function handle($request, Closure $next)
{
$this->clean($request);
return $next($request);
}
/**
* Clean the request's data.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
*/
public function handle($request, Closure $next)
{
$this->clean($request);
return $next($request);
}
/**
* Clean the request's data.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
throw new PostTooLargeException;
}
return $next($request);
}
/**
* Determine the server 'post_max_size' as bytes.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
throw new MaintenanceModeException($data['time'], $data['retry'], $data['message']);
}
return $next($request);
}
/**
* Determine if the request has a URI that should be accessible in maintenance mode.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
*/
public function handle($request, Closure $next)
{
// Check if we're dealing with CORS and if we should handle it
if (! $this->shouldRun($request)) {
return $next($request);
}
// For Preflight, return the Preflight response
if ($this->cors->isPreflightRequest($request)) {
$response = $this->cors->handlePreflightRequest($request);
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
public function handle(Request $request, Closure $next)
{
$request::setTrustedProxies([], $this->getTrustedHeaderNames()); // Reset trusted proxies between requests
$this->setTrustedProxyIpAddresses($request);
return $next($request);
}
/**
* Sets the trusted proxies on the request to the value of trustedproxy.proxies
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
{
$pipeline = array_reduce(
array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
}
/**
* Bootstrap the application for HTTP requests.
*
public function handle($request)
{
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
| and wonderful application we have prepared for them.
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
ErrorException
|
---|
ErrorException: Undefined property: stdClass::$content at D:\laravel\app\Support\ExternalPackage\Location.php:63 at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined property: stdClass::$content', 'D:\\laravel\\app\\Support\\ExternalPackage\\Location.php', 63, array('ip' => '34.237.75.165', 'type' => '', 'arr' => object(stdClass), 'ak' => '3elQMwnEb8JeJdIepdtZlCn87SenBXRh', 'url' => 'https://api.map.baidu.com/location/ip', 'param' => array('ip' => '34.237.75.165', 'coor' => 'bd09ll', 'ak' => '3elQMwnEb8JeJdIepdtZlCn87SenBXRh'), 'res' => '{"status":1,"message":"Internal Service Error:ip[34.237.75.165] loc failed"}')) (D:\laravel\app\Support\ExternalPackage\Location.php:63) at App\Support\ExternalPackage\Location::getLocationByIp('34.237.75.165', '') (D:\laravel\app\Services\Web\Infrastructure\FootprintServices.php:41) at App\Services\Web\Infrastructure\FootprintServices->Create('3ad3a9a8884be5f3', '问吧', '问题页', '', '液相色谱法溶剂如何选择?', '', '/ask/06a766dededc8cd9.html', '', '') (D:\laravel\app\Services\Web\Common\HeaderServices.php:71) at App\Services\Web\Common\HeaderServices->header('', '问题页', '', '液相色谱法溶剂如何选择?', '') (D:\laravel\app\Services\Web\Ask\QuestionServices.php:60) at App\Services\Web\Ask\QuestionServices->info('06a766dededc8cd9', object(AskQuestionInfo)) (D:\laravel\app\Http\Controllers\Web\Ask\QuestionController.php:35) at App\Http\Controllers\Web\Ask\QuestionController->Info('06a766dededc8cd9', object(AskQuestionInfo)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php:48) at Illuminate\Routing\ControllerDispatcher->dispatch(object(Route), object(QuestionController), 'Info') (D:\laravel\vendor\laravel\framework\src\Illuminate\Routing\Route.php:239) at Illuminate\Routing\Route->runController() (D:\laravel\vendor\laravel\framework\src\Illuminate\Routing\Route.php:196) at Illuminate\Routing\Route->run() (D:\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php:685) at Illuminate\Routing\Router->Illuminate\Routing\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:128) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Routing\Middleware\SubstituteBindings.php:41) at Illuminate\Routing\Middleware\SubstituteBindings->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php:49) at Illuminate\View\Middleware\ShareErrorsFromSession->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php:116) at Illuminate\Session\Middleware\StartSession->handleStatefulRequest(object(Request), object(Store), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php:62) at Illuminate\Session\Middleware\StartSession->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php:37) at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php:67) at Illuminate\Cookie\Middleware\EncryptCookies->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:103) at Illuminate\Pipeline\Pipeline->then(object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php:687) at Illuminate\Routing\Router->runRouteWithinStack(object(Route), object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php:662) at Illuminate\Routing\Router->runRoute(object(Request), object(Route)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php:628) at Illuminate\Routing\Router->dispatchToRoute(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php:617) at Illuminate\Routing\Router->dispatch(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:165) at Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:128) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php:21) at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php:21) at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ValidatePostSize.php:27) at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php:63) at Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\fruitcake\laravel-cors\src\HandleCors.php:38) at Fruitcake\Cors\HandleCors->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\fideloper\proxy\src\TrustProxies.php:57) at Fideloper\Proxy\TrustProxies->handle(object(Request), object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:103) at Illuminate\Pipeline\Pipeline->then(object(Closure)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:140) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(object(Request)) (D:\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:109) at Illuminate\Foundation\Http\Kernel->handle(object(Request)) (D:\laravel\public\index.php:45) |