|
@@ -57,16 +57,12 @@ class WxOpenService{
|
|
|
}
|
|
|
}
|
|
|
elseif($e==1){
|
|
|
- Cache::set("wx_open_openid_{$key}", $arr['openid'], 600);
|
|
|
+ //Cache::set("wx_open_openid_{$key}", $arr['openid'], 600);
|
|
|
+ if(!empty($arr['unionid'])) {
|
|
|
+ Cache::set("union_id_{$arr['openid']}", $arr['unionid'], 600);
|
|
|
+ }
|
|
|
}
|
|
|
return [true,$arr['openid'],$arr];
|
|
|
}
|
|
|
}
|
|
|
- public static function getCachedOpenId($key){
|
|
|
- $openid=Cache::get($cacheKey="wx_open_openid_{$key}",'');
|
|
|
- if($openid){
|
|
|
- Cache::rm($cacheKey);
|
|
|
- }
|
|
|
- return $openid;
|
|
|
- }
|
|
|
}
|