crmeb PRO v1.2修复获取客户端真实ip

210 阅读1分钟

文件地址:app\Request.php /** * 获取ip * @return string */ public function ip(): string { if (this->server('HTTP_CLIENT_IP', '')) { ip = this->server('HTTP_CLIENT_IP', ''); } elseif (this->server('HTTP_X_REAL_IP', '')) { ip=ip = this->server('HTTP_X_REAL_IP', ''); } elseif (this->server('HTTP_X_FORWARDED_FOR', '')) { ip = this->server('HTTP_X_FORWARDED_FOR', ''); ips = explode(',', ip);ip); ip = ips[0]; } elseif (this->server('REMOTE_ADDR', '')) { ip=ip = this->server('REMOTE_ADDR', ''); } else { ip = '0.0.0.0'; } return ip; } 复制代码 在这里插入图片描述

文件地址:crmeb\services\WechatService.php $order['spbill_create_ip'] = request()->ip(); 复制代码 在这里插入图片描述 免费源码下载地址:github.crmeb.net/u/defu