1
This commit is contained in:
parent
8d2cc83e74
commit
1323d1be8a
@ -81,15 +81,15 @@ class MPClient:
|
||||
|
||||
|
||||
# 根据unionid获取用户信息
|
||||
async def get_user_info(self, unionid: str) -> Optional[Dict]:
|
||||
async def get_user_info(self, openid: str) -> Optional[Dict]:
|
||||
"""
|
||||
获取用户基本信息
|
||||
:param unionid: 用户unionid
|
||||
:param openid: 用户openid
|
||||
:return: 用户信息字典
|
||||
"""
|
||||
try:
|
||||
access_token = await self.get_access_token()
|
||||
url = f"https://api.weixin.qq.com/cgi-bin/user/info?access_token={access_token}&unionid={unionid}&lang=zh_CN"
|
||||
url = f"https://api.weixin.qq.com/cgi-bin/user/info?access_token={access_token}&openid={openid}&lang=zh_CN"
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(url) as response:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user