refactor: 指定合法代理ip解决无法在代理情况获取真实客户端ip问题

This commit is contained in:
2025-04-18 18:04:14 +08:00
parent b9422f9ee8
commit 9ee05242ff
2 changed files with 10 additions and 0 deletions

View File

@@ -4,5 +4,12 @@ namespace app;
// 应用请求对象类
class Request extends \think\Request
{
protected $proxyServerIp = [];
public function __construct()
{
parent::__construct();
// 设置前端代理服务器IP地址让代理访问情况下正确获取真实客户端IP地址
$this->proxyServerIp = env('PROXY_SERVER_IP', ['120.79.27.160']);
}
}