zhanglinxin há 1 ano atrás
pai
commit
f28db93826
2 ficheiros alterados com 6 adições e 1 exclusões
  1. 5 0
      public/index.php
  2. 1 1
      public/router.php

+ 5 - 0
public/index.php

@@ -15,6 +15,11 @@
 
 namespace think;
 
+header('Access-Control-Allow-Credentials: true');
+header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE');
+header('Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With');
+header('Access-Control-Allow-Origin: *');
+
 require __DIR__ . '/../thinkphp/base.php';
 
 Container::get('app')->run()->send();

+ 1 - 1
public/router.php

@@ -14,7 +14,7 @@
 // +----------------------------------------------------------------------
 
 if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
-//    return false;
+    return false;
 } else {
     require __DIR__ . "/index.php";
 }