tencentyun / wafer-php-server-sdk

Wafer - 企业级微信小程序全栈方案
https://github.com/tencentyun/wafer
Other
252 stars 62 forks source link

AuthApi.php中关于处理非代理方式请求session_key的问题 #13

Closed dengnianchen closed 6 years ago

dengnianchen commented 6 years ago

使用非代理方式请求session_key时获取到的openid是错误的,一直是7200。

跟踪发现https://api.weixin.qq.com/sns/jscode2session 这个api的返回内容并不是只有session_key和openid两个字段,还会包含expire_time,而AuthApi.php的第22行

       `list($session_key, $openid) = array_values(self::getSessionKey($code));`

会把返回的expire_time赋值给$openid,所以就变成了7200。

jas0ncn commented 6 years ago

已修复:https://github.com/tencentyun/wafer-php-server-sdk/commit/e32d8877ae6324a791cb1282e8df57029f51ba64