...
|
...
|
@@ -53,7 +53,6 @@ class App { |
|
|
|
|
|
public function __construct()
|
|
|
{
|
|
|
header("Content-Type:application/json;Charset=utf8;");
|
|
|
|
|
|
$this->date = date('Y-m-d');
|
|
|
$this->dateTime = date('Y-m-d H:i:s');
|
...
|
...
|
@@ -63,7 +62,7 @@ class App { |
|
|
$this->route = new Route();
|
|
|
|
|
|
// 请求参数 TODO::不允许其他类型的请求参数
|
|
|
$this->request = my_filter($_POST);
|
|
|
$this->request = my_filter($_POST,['trim']);
|
|
|
|
|
|
|
|
|
}
|
...
|
...
|
@@ -90,9 +89,9 @@ class App { |
|
|
public static function run() {
|
|
|
$app = self::instance();
|
|
|
try {
|
|
|
if ($_SERVER['REQUEST_METHOD'] != 'POST'){
|
|
|
$app->e('need_post_request');
|
|
|
}
|
|
|
// if ($_SERVER['REQUEST_METHOD'] != 'POST'){
|
|
|
// $app->e('need_post_request');
|
|
|
// }
|
|
|
|
|
|
// 取到路由 控制器
|
|
|
$route = $app->route->get(explode('?',$_SERVER['REQUEST_URI'])[0]);
|
...
|
...
|
@@ -222,9 +221,16 @@ class App { |
|
|
|
|
|
// end code
|
|
|
|
|
|
header("Content-Type:application/json;Charset=UTF-8;");
|
|
|
// header("Content-Type:text/html;Charset=UTF-8;");
|
|
|
// header("Content-Type:text/event-stream;Charset=UTF-8;");
|
|
|
|
|
|
if(self::instance()->data){
|
|
|
echo json_encode(self::instance()->data,JSON_UNESCAPED_UNICODE);
|
|
|
}
|
|
|
|
|
|
echo json_encode(self::instance()->data,JSON_UNESCAPED_UNICODE);
|
|
|
// ob_flush();
|
|
|
// ob_clean();
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|