- wx.getUserinfo 部分用户无法获取unionid
[图片] 后台api 会存在部分用户解密出来的数据,有时候没有unionid,然后我重新调用授权接口,在进行解密又能解密出来
2018-11-07 - 搜索Widget 城区搜索正常 城市搜索 加密数据无法解析出来
- 当前 Bug 的表现(可附上截图) 搜索北京二手房价 请求数据{"ToUserName":"gh_c7606898905c","Encrypt":"ihPDCWTwYnb+UxT30WtJsIGEsXzXtKujXqdKBXQuGpbf8bdj58N/59w3uxbgZZsZ4TJ8VORfmFDOsqbc49p9Czv4mNCKHLofar9aqPZo3uGqHxH1+wrBTbD2z0Sh8ARX0LWNpaiRDILmv7YfCFn14kyyYR+rA1fstpRSZ0ZN6/FqC0+LO5Rfnp1pKwhSskv5JZ7AsggPpR87OXA0b62Fjun7UrBzryDsCLPrP7EuJVg439xEIjPeuRziF3kWM2iJF+myyuToMIVOFST9+M4tavzdMtmaX+xZOtji56YtRnTFtsM2vROjEMpb6VbjFDUC5/5y+pfrjY+2UoueB2qFCkwNyIragwMV6lrBgx1/goFeKJ61cHPbta2bLLPQI7qcPdRiLGBxkIE3+P91of5DDWly1WysglYoPUqDQAIsEPwOtyuVLiP2Ep8wgyXUNjdQRZeZ/HgDCbsjLY4P/7e7qT6tXEWVvo2CTakDhfz/04pv0EUMUi41gVgiybZz/w9EEOIDc9D//IZQwATUvrzKtVKwLx/eA6CegbclhMr2TzmbohCZlQJf5xwtcaXIE4/C1aNrlqe8GIZkpRhoLuLq9RnPInu4dnpIeoAGGlQL67x0eun+722FZnOKYA4qkBqr"} 解析出来为空 当搜索城区的时候正常(昌平二手房价) 请求数据{"ToUserName":"gh_c7606898905c","Encrypt":"OS5bUerjXe94YZfSuhkpxZ+EX+bK4A62k9Y8bAjXCuroq4ORCh/d+drYugwXXd+vBlMun5arXpEPfZcfaUGJrFdmbbTTXBiDOCDs+24VPqyztf9doVpri9dUAjuMr42AClyXj17BWFzcN5A5UsgZAhw2xBwMpi+Yp9C7J3LVjo33KSDNN+VO4AcFgrLe63dB0in2DxEo5UC29LUwPFzWnl6sX5cS9eO9VZkCDIxp2QVMdxdTol+jqtSMXmbC+aUqvTZRxYiKMHDEeD5lr7yTQIT1XBwKnXozNYVo7Hs9sjP+3xJkVnRTsRunmcWEs2DHzUr3IUxCLuBJsa/8Wtpe48SsainSNeHMiLPbatRuF/J/N7PoUm3kWKR90Ir/zQ8OE7BlEDhp2DC6rHZpWIOPZJyBQWKX5Txtkvlu2FLXcQrnRGaeDKecYXtIZr5e3xzAYKUHX/oU9wl7Sj0b18YM2LB3cvlzc06T2aoWtfDKfWGtKEdAwQ7HKvU/020n/JaDOhWVxjyIbLt4n8Q9xTKfYC/KXgd8AkmrHV0oIbyk4T644uyEdAcOEcVZXjsht2c/3GDeWcjWq0RZjTa1CShCP72ecBWCAQ6gszLv3WmLe/eQS1r1gUrndGc6ceMHBen4"} 解析数据 [0,"{\"ToUserName\":\"gh_c7606898905c\",\"FromUserName\":\"oITbH5cw7KCyArdxfEn_ATL5Nbtc\",\"CreateTime\":1541402593,\"MsgType\":\"event\",\"Event\":\"wxa_widget_data\",\"CacheKey\":\"be5039cb504b6b3ed016e9054767c268\",\"Query\":\"{\\\"type\\\":11,\\\"slot_list\\\":[{\\\"key\\\":\\\"district\\\",\\\"value\\\":\\\"\u660c\u5e73\u533a\\\"},{\\\"key\\\":\\\"gps_city\\\",\\\"value\\\":\\\"\u5317\u4eac\u5e02\\\"}],\\\"longitude\\\":116.466201782,\\\"latitude\\\":39.873622894,\\\"search_id\\\":\\\"2831188717034000340\\\"}\",\"Scene\":1}"] 解析函数 public function decrypt($encrypted, $appid) { try { $iv = substr($this->key, 0, 16); $decrypted = openssl_decrypt(base64_decode($encrypted),'AES-256-CBC',$this->key,OPENSSL_RAW_DATA,$iv); } catch (Exception $e) { return array(ErrorCode::$DecryptAESError, null); } try { //去除补位字符 $pkc_encoder = new PKCS7Encoder; $result = $pkc_encoder->decode($decrypted); //去除16位随机字符串,网络字节序和AppId if (strlen($result) < 16) return ""; $content = substr($result, 16, strlen($result)); $len_list = unpack("N", substr($content, 0, 4)); $xml_len = $len_list[1]; $xml_content = substr($content, 4, $xml_len); $from_appid = substr($content, $xml_len + 4); } catch (Exception $e) { //print $e; return array(ErrorCode::$IllegalBuffer, null); } if ($from_appid != $appid) return array(ErrorCode::$ValidateAppidError, null); return array(0, $xml_content); } php7.2版本 - 预期表现 - 复现路径 - 提供一个最简复现 Demo
2018-11-05 - 搜索Widget 导入抽样数据 错误48001 没有api权限
- 当前 Bug 的表现(可附上截图) 接口地址: [代码]http(s)://api.weixin.qq.com/wxa/setdynamicdata?access_token=ACCESS_TOKEN[代码]接口返回: Array ( [errcode] => 48001 [errmsg] => api unauthorized hint: [08640729] ) - 预期表现 - 复现路径 - 提供一个最简复现 Demo
2018-11-04