dyjh 6 năm trước cách đây
mục cha
commit
5bcc8f3770

+ 25 - 0
app/Http/Middleware/VerifyCsrfToken.php

@@ -19,4 +19,29 @@ class VerifyCsrfToken extends BaseVerifier
         '/web/notify-account'
         '/web/notify-account'
     ];
     ];
 
 
+    public function handle($request, Closure $next)
+    {
+        // 如果是来自 api 域名,就跳过检查
+
+        $QUERY_STRING = explode('/', $_SERVER['QUERY_STRING']);
+        // dd($QUERY_STRING);die;
+        if($QUERY_STRING[0] == 'route=admin' && $QUERY_STRING[1] == 'Base' && $QUERY_STRING[2] == 'Attachment'){
+            return $next($request);
+        }
+
+        if($QUERY_STRING[0] == 'route=wechat'){
+            return $next($request);
+        }
+        if($QUERY_STRING[0] == 'route=Api'){
+            return $next($request);
+        }
+
+        if($QUERY_STRING[0] == 'route=notify'){
+            return $next($request);
+        }
+        return parent::handle($request, $next);
+
+
+
+    }
 }
 }