加入了头像信息
This commit is contained in:
@@ -35,6 +35,34 @@ class UserMixin(WechatAPIClientBase):
|
||||
else:
|
||||
self.error_handler(json_resp)
|
||||
|
||||
async def get_profile_info_ext(self, wxid: str = None) -> dict:
|
||||
"""获取用户扩展信息。
|
||||
|
||||
Args:
|
||||
wxid (str, optional): 用户wxid. Defaults to None.
|
||||
|
||||
Returns:
|
||||
dict: 用户信息字典
|
||||
|
||||
Raises:
|
||||
UserLoggedOut: 未登录时调用
|
||||
根据error_handler处理错误
|
||||
"""
|
||||
if not self.wxid and not wxid:
|
||||
raise UserLoggedOut("请先登录")
|
||||
|
||||
if not wxid:
|
||||
wxid = self.wxid
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
response = await session.post(f'http://{self.ip}:{self.port}/api/User/GetContractProfile?wxid={wxid}')
|
||||
json_resp = await response.json()
|
||||
|
||||
if json_resp.get("Success"):
|
||||
return json_resp.get("Data").get("userInfoExt")
|
||||
else:
|
||||
self.error_handler(json_resp)
|
||||
|
||||
async def get_my_qrcode(self, style: int = 0) -> str:
|
||||
"""获取个人二维码。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user