<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2019 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// [ 应用入口文件 ]
namespace think;
/*header('Content-Type: text/html;charset=utf-8');
header('Access-Control-Allow-Origin:*'); // *代表允许任何网址请求
header('Access-Control-Allow-Methods:POST,GET,OPTIONS'); // 允许请求的类型
//header('Access-Control-Allow-Headers:Content-Type,token,model,from,x-requested-with'); // 设置允许自定义请求头的字段 1.注意不能写* ，2.要加Content-Type
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization'); **/

//  $res = [
//             'state' => 0,
//             'code'  => 500,
//             'msg'   => "项目维护中1",
//             'data'  => []
//         ];

$currentHour = date('H'); // 获取当前小时（24小时制，带前导零，如 02, 15）

 
if ($currentHour >= 3 && $currentHour < 7) {
    $res = [
        'state' => 0,
        'code'  => 500,
        'msg'   => "项目升级中",
        'data'  => []
    ];

   
    die(json_encode($res,JSON_UNESCAPED_UNICODE));
   
}


//         die(json_encode($res,JSON_UNESCAPED_UNICODE));
if( $_SERVER['REQUEST_METHOD'] == 'OPTIONS'){
    exit;
}



include_once("./_before.php");
require __DIR__ . '/../vendor/autoload.php';

// 执行HTTP应用并响应
$http = (new App())->http;

$response = $http->run();

$response->send();

$http->end($response);
