mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
404异常跳转URL配置参数 改为 异常模板地址参数 http_exception_template
This commit is contained in:
@@ -223,7 +223,7 @@ class Response
|
|||||||
public function header($name, $value = null)
|
public function header($name, $value = null)
|
||||||
{
|
{
|
||||||
if (is_array($name)) {
|
if (is_array($name)) {
|
||||||
$this->header = $name;
|
$this->header = array_merge($this->header, $name);
|
||||||
} else {
|
} else {
|
||||||
$this->header[$name] = $value;
|
$this->header[$name] = $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,10 +95,10 @@ class Handle
|
|||||||
*/
|
*/
|
||||||
protected function renderHttpException(HttpException $e)
|
protected function renderHttpException(HttpException $e)
|
||||||
{
|
{
|
||||||
$status = $e->getStatusCode();
|
$status = $e->getStatusCode();
|
||||||
$error = Config::get('http_exception_url');
|
$template = Config::get('http_exception_template');
|
||||||
if (!APP_DEBUG && !empty($error[$status])) {
|
if (!APP_DEBUG && !empty($template[$status])) {
|
||||||
return Response::create($error[$status], 'redirect')->send();
|
return Response::create($template[$status], 'view')->vars(['e' => $e])->send();
|
||||||
} else {
|
} else {
|
||||||
return $this->convertExceptionToResponse($e);
|
return $this->convertExceptionToResponse($e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user