mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
修正App类
This commit is contained in:
@@ -100,9 +100,6 @@ class App
|
|||||||
// 规则闭包
|
// 规则闭包
|
||||||
$data = self::invokeFunction($dispatch['function'], $dispatch['params']);
|
$data = self::invokeFunction($dispatch['function'], $dispatch['params']);
|
||||||
break;
|
break;
|
||||||
case 'finish':
|
|
||||||
// 已经完成 不再继续执行
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
throw new Exception('dispatch type not support', 10008);
|
throw new Exception('dispatch type not support', 10008);
|
||||||
}
|
}
|
||||||
@@ -111,16 +108,16 @@ class App
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 监听app_end
|
// 监听app_end
|
||||||
APP_HOOK && Hook::listen('app_end', isset($data) ? $data : '');
|
APP_HOOK && Hook::listen('app_end', $data);
|
||||||
if (isset($data)) {
|
|
||||||
// 输出数据到客户端
|
// 输出数据到客户端
|
||||||
if ($data instanceof Response) {
|
if ($data instanceof Response) {
|
||||||
return $data->send();
|
return $data->send();
|
||||||
} else {
|
} elseif (!is_null($data)) {
|
||||||
$type = IS_AJAX ? Config::get('default_ajax_return') : Config::get('default_return_type');
|
$type = IS_AJAX ? Config::get('default_ajax_return') : Config::get('default_return_type');
|
||||||
return Response::create($data, $type)->send();
|
return Response::create($data, $type)->send();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行函数或者闭包方法 支持参数调用
|
// 执行函数或者闭包方法 支持参数调用
|
||||||
|
|||||||
Reference in New Issue
Block a user