<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// [ 应用入口文件 ]
namespace think;

// 允许的跨域头
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:OPTIONS,GET,POST,PUT,DELETE');
header('Access-Control-Allow-Credentials:true');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Token, token, Authorization');
header('Access-Control-Max-Age:' . (86400 * 30));

// 判断是options请求 返回204
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'OPTIONS') {
    // 响应204状态码
    http_response_code(204);
    exit;
}
// header('Content-Type:application/json; charset=utf-8');
// echo '{"info":{"ok":false,"message":"系统维护中"},"code":200,"data":[]}';
// exit;
require __DIR__ . '/cache.php';


// 加载基础文件
require __DIR__ . '/../thinkphp/base.php';

//引入淘宝的sdk
require __DIR__ . '/../extend/AliSdk/TopSdk.php';
// 支持事先使用静态方法设置Request对象和Config对象
//引入京东的sdk
// 执行应用并响应
require __DIR__ . '/../extend/Jd/JdSdk.php';
require __DIR__ . '/../extend/qrcode/phpqrcode.php';
// 定义全局debug变量
$debug = file_exists(__DIR__ . '/../.pro') ? false : true;
define("DEBUG", $debug);
define("ROOT_PATH", __DIR__ . '/..');
Container::get('app')->run()->send();
