mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
助手函数改进 App类改进
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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':
|
||||
// 模块/控制器/操作
|
||||
|
||||
Reference in New Issue
Block a user