Browse Source

Weenier utc项目部署

wesmiler 4 years ago
parent
commit
6a90be12d9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/Http/Middleware/EnableCrossRequestMiddleware.php

+ 1 - 1
app/Http/Middleware/EnableCrossRequestMiddleware.php

@@ -35,7 +35,7 @@ class EnableCrossRequestMiddleware
         $response = $next($request);
         $origin = $request->server('HTTP_ORIGIN') ? $request->server('HTTP_ORIGIN') : '';
         $allow_origin = [];
-        if (in_array($origin, $allow_origin)) {
+        if (empty($allow_origin) || in_array($origin, $allow_origin)) {
             //允许所有资源跨域
             $response->header('Access-Control-Allow-Origin', $origin);
             // 允许通过的响应报头