mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
redirect助手函数 仍然返回response对象
This commit is contained in:
@@ -490,7 +490,7 @@ if (!function_exists('redirect')) {
|
|||||||
* @param mixed $url 重定向地址 支持Url::build方法的地址
|
* @param mixed $url 重定向地址 支持Url::build方法的地址
|
||||||
* @param array|integer $params 额外参数
|
* @param array|integer $params 额外参数
|
||||||
* @param integer $code 状态码
|
* @param integer $code 状态码
|
||||||
* @return void
|
* @return \think\response\Redirect
|
||||||
*/
|
*/
|
||||||
function redirect($url = [], $params = [], $code = 302)
|
function redirect($url = [], $params = [], $code = 302)
|
||||||
{
|
{
|
||||||
@@ -498,8 +498,7 @@ if (!function_exists('redirect')) {
|
|||||||
$code = $params;
|
$code = $params;
|
||||||
$params = [];
|
$params = [];
|
||||||
}
|
}
|
||||||
$response = Response::create($url, 'redirect', $code)->params($params);
|
return Response::create($url, 'redirect', $code)->params($params);
|
||||||
throw new HttpResponseException($response);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user