This commit is contained in:
2024-07-13 18:23:43 +08:00
parent 3190f3cfed
commit 35a0d489f8

View File

@@ -18,5 +18,12 @@ require __DIR__ . '/../thinkphp/base.php';
// 支持事先使用静态方法设置Request对象和Config对象 // 支持事先使用静态方法设置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(); Container::get('app')->run()->send();