<?php

// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库：https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------

namespace think;

require __DIR__ . '/../thinkphp/base.php';

if(isset($_SERVER["HTTP_ORIGIN"])) {
    header('Access-Control-Allow-Origin:'.$_SERVER["HTTP_ORIGIN"]);
}
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With,Access-Token, apptype, aeskey, device, sign, version,lang,x-encrypt");
header("Access-Control-Allow-Methods: GET,POST,INPUT,OPTION");
 
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'OPTIONS') {
	header('Access-Control-Allow-Origin:'.$_SERVER["HTTP_ORIGIN"]);
	header("Access-Control-Allow-Credentials: true");
	header("Access-Control-Allow-Headers: Content-Type,access_token,Keep-Alive,X-Requested-With, apptype, aeskey, device, sign, version,lang,x-encrypt");
	header("Access-Control-Allow-Methods: GET,POST,INPUT,OPTION");
	http_response_code(200);
    exit;
}

Container::get('app')->run()->send();