陈德本 %!s(int64=5) %!d(string=hai) anos
pai
achega
912eb87cae
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      Frame/Dispatcher.php

+ 4 - 0
Frame/Dispatcher.php

@@ -60,6 +60,10 @@ class Dispatcher
      */
     public static function dispatch($customPrefix, $pathInfo = '')
     {
+        header("HTTP/1.1 200");
+        header("Access-Control-Allow-Origin: *");
+        header("Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE");
+        header("Access-Control-Allow-Headers: *");
         // 获取前缀
         $prefix = '\Heanup\\App\\' . self::convertToClassName($customPrefix) . "\\Controller";
         if (!$pathInfo) {