小程序wx.getUserInfo接口出问题了
我想获取用户基本信息,先是用wx.login获得code,再用code获得session_key,然后小程序用wx.getUserInfo接口返回了rawData和signature、encryptedData,然而在后台通过sha1加密签名(rawData+session_key)与signature进行加密检验的时候,发现有部分用户校验失败的,经排查发现如果用户微信昵称带emoji表情符号的时候就会出问题,以前一直登录的时候不会有这种情况,我就想问一下是不是你们这边改接口导致签名所用到的参数有问题???
10 回复
确实不一致。真心不知道问题出在哪,字符串前前后后排查了很多次,传给php后台的sha1签名后,就是对比不一致
openid: "oP9ym5POeHoY56HWQZTPIqMh0Z6k" rawData: "{" nickName ":" 陈晓~ "," gender ":1," language ":" zh_CN "," city ":" New Taipei City "," province ":" Taiwan "," country ":" China "," avatarUrl ":" https: //wx.qlogo.cn/mmopen/vi_32/DYAIOgq83eq59ON4ianEib25e4hGDT1RpkuVhxhQyxhHFqm3kJnIRd8n8MbT5qFht7XS6CkpkB8Ru54QG3dLdtzA/132"}" session_key: "MojblXMrOaWk2WxUr467rA==" sign_str: "{" nickName ":" 陈晓~ "," gender ":1," language ":" zh_CN "," city ":" New Taipei City "," province ":" Taiwan "," country ":" China "," avatarUrl ":" https: //wx.qlogo.cn/mmopen/vi_32/DYAIOgq83eq59ON4ianEib25e4hGDT1RpkuVhxhQyxhHFqm3kJnIRd8n8MbT5qFht7XS6CkpkB8Ru54QG3dLdtzA/132"}MojblXMrOaWk2WxUr467rA==" signature: "ee59d6848251673d9f9fa6691b5eb7df77e76730" signature2: "79284c5a82346d42eee28382b397ad690ac16318" |