<?php

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

namespace think;

use think\admin\service\SystemService;

// 加载基础文件
require __DIR__ . '/../vendor/autoload.php';


// 支持事先使用静态方法设置Request对象和Config对象
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    header('Access-Control-Allow-Origin: *');
    //第二行是header自定义要认证的内容
    header('Access-Control-Allow-Headers: x-access-token,app-type,did,model,sign,version, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With');
    header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE');
    header('Access-Control-Max-Age: 1728000');
    Response::create()->send();
} else {
    header('Access-Control-Allow-Origin: *');
    //第二行是header自定义要认证的内容
    header('Access-Control-Allow-Headers: x-access-token,app-type,did,model,sign,version, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With');
    header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE');
}
// WEB应用初始化
SystemService::instance()->doInit();