qifengquan 1 年之前
父節點
當前提交
cf49172699
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      public/index.php

+ 8 - 0
public/index.php

@@ -11,6 +11,13 @@
 // +----------------------------------------------------------------------
 // [ 应用入口文件 ]
 // 定义应用目录
+header('Access-Control-Allow-Origin: *');
+header("Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, token, Accept");
+header('Access-Control-Allow-Methods: POST,GET');
+if(request()->isOptions()){
+    exit();
+}
+
 define('APP_PATH', __DIR__ . '/../application/');
 
 // 判断是否安装
@@ -21,3 +28,4 @@ if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
 
 // 加载框架引导文件
 require __DIR__ . '/../thinkphp/start.php';
+