Request.php 554 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app;
  3. /**
  4. * 应用请求对象类
  5. */
  6. class Request extends \think\Request
  7. {
  8. /**
  9. * 全局过滤规则
  10. * app/common.php 的 filter 函数
  11. */
  12. protected $filter = 'filter';
  13. public function __construct()
  14. {
  15. parent::__construct();
  16. // 从配置文件读取代理服务器ip,并设置给 \think\Request
  17. $proxyServerIp = config('buildadmin.proxy_server_ip');
  18. if (is_array($proxyServerIp) && $proxyServerIp) {
  19. $this->proxyServerIp = $proxyServerIp;
  20. }
  21. }
  22. }