查询投诉单详情API 获取到的图片url含"+/"特殊字符串 会导致图片打不开如何解决
同一个历史协商接口里面两个数据 https://api.mch.weixin.qq.com/v3/merchant-service/images/ChsyMDAwMDAwMjAyNDEwMjgxNjAyMjE4NTgyMTISGzMwMDIwMDAyMDI0MTAyODE5NTE4MzA0NTM0MxgAILyA%2FrgGKAMwATgB https://api.mch.weixin.qq.com/v3/merchant-service/images/ChsyMDAwMDAwMjAyNDEwMjgxNjAyMjE4NTgyMTIYACC8gP64BigBMAE4AQ%3D%3D 下面的media_id 就可以正常访问,但是上面带有%2F 的图片就无法访问 获取图片地址的代码如下 $stack = clone $this->builder->getDriver()->select()->getConfig('handler');
$stack->remove('verifier');
// 下载接口都是非标接口,要特殊搞一下 要 {+media_slot_url} 这样的语法结构
$response = $this->builder->chain('v3/merchant-service/images/{+media_slot_url}')->get([
'handler' => $stack,
'media_slot_url' => $mediaId,
]);
if ($response->getStatusCode() == 200) {
return [current($response->getHeader('Content-Type')), base64_encode($response->getBody()->getContents())];
}