You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< ? php
namespace tencent\wechat\weixin ;
use EasyWeChat\Factory ;
class User extends Base
{
/**
* 通过OPENID获取用户信息
* @param string $openid 用户OPENID
* @date 2022-02-09
*/
public function getUserInfo ( $openid )
{
$app = Factory :: officialAccount ( $this -> weixinConfig );
$data = $app -> user -> get ( $openid );
//更新微信用户信息 (2021年12月27日之后, 不再输出头像、昵称信息)
//官方公告: https://developers.weixin.qq.com/doc/offiaccount/User_Management/Get_users_basic_information_UnionID.html#UinonId
unset ( $data [ 'nickname' ]);
unset ( $data [ 'sex' ]);
unset ( $data [ 'province' ]);
unset ( $data [ 'city' ]);
unset ( $data [ 'country' ]);
unset ( $data [ 'headimgurl' ]);
return $data ;
}
}