助手函数改进 App类改进

This commit is contained in:
thinkphp
2016-05-17 11:43:03 +08:00
parent 92d999b484
commit de18afa9e6
2 changed files with 2 additions and 3 deletions

View File

@@ -428,6 +428,5 @@ function xml($data = [], $code = 200, $options = [])
*/
function redirect($url = [], $code = 200, $params = [])
{
$response = Response::create($url, 'redirect')->code($code)->params($params);
throw new HttpResponseException($response);
return Response::create($url, 'redirect')->code($code)->params($params);
}

View File

@@ -82,7 +82,7 @@ class App
switch ($dispatch['type']) {
case 'redirect':
// 执行重定向跳转
header('Location: ' . $dispatch['url'], true, $dispatch['status']);
$data = Response::create($dispatch['url'], 'redirect')->code($dispatch['status']);
break;
case 'module':
// 模块/控制器/操作