crmeb pro v1.2 h5微信支付是提示参数错误的问题修复

200 阅读1分钟

发现问题:h5使用微信支付时,提示参数错误。

修复办法:

1.修改文件app/Request.php文件中,增加获取ip的方法 在这里插入图片描述

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; } 复制代码 2.在文件crmeb/services/WechatService.php内的paymentOrder方法中增加 在这里插入图片描述

$order['spbill_create_ip'] = request()->ip(); 复制代码 修复完成后重启swoole

免费源码下载地址:github.crmeb.net/u/defu