mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
增加HTTP异常的重定向页面定义 增加 http_exception_url 配置参数
This commit is contained in:
@@ -62,7 +62,6 @@ class Handle
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +81,7 @@ class Handle
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $output
|
* @param Output $output
|
||||||
* @param Exception $e
|
* @param Exception $e
|
||||||
*/
|
*/
|
||||||
public function renderForConsole(Output $output, Exception $e)
|
public function renderForConsole(Output $output, Exception $e)
|
||||||
@@ -92,16 +91,18 @@ class Handle
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param HttpException $e
|
* @param HttpException $e
|
||||||
* @return \think\Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
protected function renderHttpException(HttpException $e)
|
protected function renderHttpException(HttpException $e)
|
||||||
{
|
{
|
||||||
$status = $e->getStatusCode();
|
$status = $e->getStatusCode();
|
||||||
|
$error = Config::get('http_exception_url');
|
||||||
//TODO 根据状态码自动输出错误页面
|
if (!APP_DEBUG && !empty($error[$status])) {
|
||||||
|
return Response::create($error[$status], 'redirect')->send();
|
||||||
|
} else {
|
||||||
return $this->convertExceptionToResponse($e);
|
return $this->convertExceptionToResponse($e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Exception $exception
|
* @param Exception $exception
|
||||||
|
|||||||
Reference in New Issue
Block a user