mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
改进
This commit is contained in:
10
helper.php
10
helper.php
@@ -18,6 +18,8 @@ use think\Config;
|
|||||||
use think\Cookie;
|
use think\Cookie;
|
||||||
use think\Db;
|
use think\Db;
|
||||||
use think\Debug;
|
use think\Debug;
|
||||||
|
use think\exception\HttpException;
|
||||||
|
use think\exception\HttpResponseException;
|
||||||
use think\Lang;
|
use think\Lang;
|
||||||
use think\Loader;
|
use think\Loader;
|
||||||
use think\Log;
|
use think\Log;
|
||||||
@@ -497,7 +499,7 @@ if (!function_exists('redirect')) {
|
|||||||
$params = [];
|
$params = [];
|
||||||
}
|
}
|
||||||
$response = Response::create($url, 'redirect', $code)->params($params);
|
$response = Response::create($url, 'redirect', $code)->params($params);
|
||||||
throw new \think\exception\HttpResponseException($response);
|
throw new HttpResponseException($response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,9 +513,9 @@ if (!function_exists('abort')) {
|
|||||||
function abort($code, $message = null, $header = [])
|
function abort($code, $message = null, $header = [])
|
||||||
{
|
{
|
||||||
if ($code instanceof Response) {
|
if ($code instanceof Response) {
|
||||||
throw new \think\exception\HttpResponseException($code);
|
throw new HttpResponseException($code);
|
||||||
} else {
|
} else {
|
||||||
throw new \think\exception\HttpException($code, $message, null, $header);
|
throw new HttpException($code, $message, null, $header);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -526,7 +528,7 @@ if (!function_exists('halt')) {
|
|||||||
function halt($var)
|
function halt($var)
|
||||||
{
|
{
|
||||||
dump($var);
|
dump($var);
|
||||||
throw new \think\exception\HttpResponseException(new Response);
|
throw new HttpResponseException(new Response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user