同样出现这个问题,非常难以排查。
/sns/component/jscode2session 获取的openid不正确开放平台第三方平台帮小程序获取openid的时候,出现了问题,有偶然性的出现获取openid 一样的情况。查了很多天,应该不是我们自己代码的问题。因为发起请求的时候,每个请求客户端的ip不一样,说明不是一个设备上的请求。比如下面这几个接口,返回的内容一样的。 https://api.weixin.qq.com/sns/component/jscode2session?appid=wx6e4a6b9beaad81ad&js_code=021NzKkl2gbWN54fdvml2X8P6e1NzKk6&grant_type=authorization_code&component_appid=wxa2ec950ad1539de4&component_access_token=38_iKDts5X7GkRUs6QopMKOYA2LnHsg2-rgXq9ZisS1YlHhb6xZI3JCEVnBdUs-Ps50iVwVJle2TcnkOMzmRUkE0BgmJNpwz9DlrtKG4FYl8U9hNm25LYgwJZ-gKrRL5aXX5I_VXCoom1pBAh7SMUJbAIAAIX 返回值:{"session_key":"GH2YJYUETA\/cgWzi6WD5\/w==","openid":"or5cK4wJD5kT153a_9S0sS-biMa4"} https://api.weixin.qq.com/sns/component/jscode2session?appid=wx6e4a6b9beaad81ad&js_code=001aWk0w3owm8V2WQZ1w3Saypx1aWk0v&grant_type=authorization_code&component_appid=wxa2ec950ad1539de4&component_access_token=38_iKDts5X7GkRUs6QopMKOYA2LnHsg2-rgXq9ZisS1YlHhb6xZI3JCEVnBdUs-Ps50iVwVJle2TcnkOMzmRUkE0BgmJNpwz9DlrtKG4FYl8U9hNm25LYgwJZ-gKrRL5aXX5I_VXCoom1pBAh7SMUJbAIAAIX 返回值:{"session_key":"GH2YJYUETA\/cgWzi6WD5\/w==","openid":"or5cK4wJD5kT153a_9S0sS-biMa4"}; https://api.weixin.qq.com/sns/component/jscode2session?appid=wx6e4a6b9beaad81ad&js_code=051gE1ll2SPFN54tp5ml2k0Rye2gE1lk&grant_type=authorization_code&component_appid=wxa2ec950ad1539de4&component_access_token=38_iKDts5X7GkRUs6QopMKOYA2LnHsg2-rgXq9ZisS1YlHhb6xZI3JCEVnBdUs-Ps50iVwVJle2TcnkOMzmRUkE0BgmJNpwz9DlrtKG4FYl8U9hNm25LYgwJZ-gKrRL5aXX5I_VXCoom1pBAh7SMUJbAIAAIX 返回值:{"session_key":"GH2YJYUETA\/cgWzi6WD5\/w==","openid":"or5cK4wJD5kT153a_9S0sS-biMa4"}; https://api.weixin.qq.com/sns/component/jscode2session?appid=wx6e4a6b9beaad81ad&js_code=051W3p000Tc3tK1gME100cydoH3W3p0g&grant_type=authorization_code&component_appid=wxa2ec950ad1539de4&component_access_token=38_iKDts5X7GkRUs6QopMKOYA2LnHsg2-rgXq9ZisS1YlHhb6xZI3JCEVnBdUs-Ps50iVwVJle2TcnkOMzmRUkE0BgmJNpwz9DlrtKG4FYl8U9hNm25LYgwJZ-gKrRL5aXX5I_VXCoom1pBAh7SMUJbAIAAIX 返回值 {"session_key":"GH2YJYUETA\/cgWzi6WD5\/w==","openid":"or5cK4wJD5kT153a_9S0sS-biMa4"}; 这几个接口不是同一个人发起的,但是结果完全一样。能确定的是每个请求的用户实际上都是不一样的。 通过客户端ip判断的。
05-31