zz 6 lat temu
rodzic
commit
9e44a26f9f
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      app/Http/Middleware/ReadOauth.php

+ 6 - 1
app/Http/Middleware/ReadOauth.php

@@ -809,7 +809,12 @@ class ReadOauth
         //Log::info('66666666666666666666666666666');
         //用户的类型是初始类型  区域还没获取
         if ($yq_book_user->type == 'INIT') {
-            $area = $this->getIpArea(get_client_ip());
+            if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']){
+                $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+            }else{
+                $ip = get_client_ip();
+            }
+            $area = $this->getIpArea($ip);
             $area = $area ? $area : 'unknown';
             $type = $this->isLimit($area);
             $data = ['area' => $area, 'type' => $type];