Browse Source

'获取真实ip'

lh 3 years ago
parent
commit
d33050b548
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/Middleware/CompanyAuth.php

+ 1 - 0
src/Middleware/CompanyAuth.php

@@ -21,6 +21,7 @@ class CompanyAuth
         $validate = new CompanyAuthRequest($request);
         $validate->validate();
         $client_ip = CommonHelper::GetClientIp();
+        $request->setTrustedProxies($request->getClientIps(), $client_ip);
         if (in_array($client_ip, $service->CompanyAuthIps($app_id))) {
             $params = $request->except('_url');
             $timestamp = (int) $params['timestamp'];