diff --git a/digital_doctor/public/index.php b/digital_doctor/public/index.php index 2c6fbe2..a9b130e 100644 --- a/digital_doctor/public/index.php +++ b/digital_doctor/public/index.php @@ -18,5 +18,12 @@ require __DIR__ . '/../thinkphp/base.php'; // 支持事先使用静态方法设置Request对象和Config对象 + +header("Access-Control-Allow-Origin: *");//允许所有地址跨域请求 +// CORS +// 告诉浏览器, 允许哪些请求方式 +header("Access-Control-Request-Methods:GET, POST"); +// 告诉浏览器, 允许哪些额外的请求头信息 +header('Access-Control-Allow-Headers:x-requested-with,content-type,test-token,token,test-sessid,authorization'); // 执行应用并响应 Container::get('app')->run()->send();