Closed ovolh closed 1 year ago
v3.3.0
thinkphp6 使用v3.2.14功能正常,升级v3.3.0 时,thinkphp加载环境变量函数 env()与hyperf/utils中 env() 冲突,会使用hyperf/utils中 env() ,导致请求参数缺失,请求的所有接口都异常, v3.2.14是正常的
配置文件中
'mch_id' => env('wx.mch_id', ''),
{ "exception": null, "response": { "headers": { "Server": [ "nginx" ], "Date": [ "Tue, 30 May 2023 07:32:47 GMT" ], "Content-Type": [ "application/json; charset=utf-8" ], "Content-Length": [ "252" ], "Connection": [ "keep-alive" ], "Keep-Alive": [ "timeout=8" ], "Cache-Control": [ "no-cache, must-revalidate" ], "X-Content-Type-Options": [ "nosniff" ], "Request-ID": [ "089FCDD6A306106018B5DFEEA30620800D28A019-270924332", "089FCDD6A306106018B5DFEEA30620800D28A019-0" ], "Content-Language": [ "zh-CN" ] }, "body": "{\"code\":\"SIGN_ERROR\",\"detail\":{\"detail\":{\"issue\":\"sign not match\"},\"field\":\"signature\",\"location\":\"authorization\",\"sign_information\":{\"method\":\"\",\"sign_message_length\":141733169,\"truncated_sign_message\":\"\",\"url\":\"\"}},\"message\":\"Authorization不合法\"}" }, "extra": { "headers": { "Server": [ "nginx" ], "Date": [ "Tue, 30 May 2023 07:32:47 GMT" ], "Content-Type": [ "application/json; charset=utf-8" ], "Content-Length": [ "252" ], "Connection": [ "keep-alive" ], "Keep-Alive": [ "timeout=8" ], "Cache-Control": [ "no-cache, must-revalidate" ], "X-Content-Type-Options": [ "nosniff" ], "Request-ID": [ "089FCDD6A306106018B5DFEEA30620800D28A019-270924332", "089FCDD6A306106018B5DFEEA30620800D28A019-0" ], "Content-Language": [ "zh-CN" ] }, "body": "{\"code\":\"SIGN_ERROR\",\"detail\":{\"detail\":{\"issue\":\"sign not match\"},\"field\":\"signature\",\"location\":\"authorization\",\"sign_information\":{\"method\":\"\",\"sign_message_length\":141735169,\"truncated_sign_message\":\"\",\"url\":\"\"}},\"message\":\"Authorization不合法\"}" } }
[5003][/www/项目/vendor/yansongda/pay/src/Functions.php:203]
得等到后面 php8 的版本了
更新到 v3.4.0 版本,同时 hyperf/pimple 升级至 v2.2.0 及以上版本即可
包版本号
v3.3.0
问题描述
thinkphp6 使用v3.2.14功能正常,升级v3.3.0 时,thinkphp加载环境变量函数 env()与hyperf/utils中 env() 冲突,会使用hyperf/utils中 env() ,导致请求参数缺失,请求的所有接口都异常, v3.2.14是正常的
你的代码
配置文件中
报错详情
sdk 日志