mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
Route类改进 支持在匹配到路由后 使用after_behavior支持路由规则重定向
This commit is contained in:
@@ -25,7 +25,7 @@ class App
|
||||
* 执行应用程序
|
||||
* @access public
|
||||
* @param \think\Request $request Request对象
|
||||
* @return \think\Response
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function run($request)
|
||||
@@ -97,9 +97,12 @@ class App
|
||||
$data = self::invokeMethod($dispatch['method'], $dispatch['params']);
|
||||
break;
|
||||
case 'function':
|
||||
// 规则闭包
|
||||
// 执行闭包
|
||||
$data = self::invokeFunction($dispatch['function'], $dispatch['params']);
|
||||
break;
|
||||
case 'response':
|
||||
$data = $dispatch['response'];
|
||||
break;
|
||||
default:
|
||||
throw new Exception('dispatch type not support', 10008);
|
||||
}
|
||||
@@ -117,7 +120,6 @@ class App
|
||||
$type = IS_AJAX ? Config::get('default_ajax_return') : Config::get('default_return_type');
|
||||
return Response::create($data, $type)->send();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 执行函数或者闭包方法 支持参数调用
|
||||
|
||||
Reference in New Issue
Block a user