调整chrome内容

This commit is contained in:
liuwei
2025-05-07 09:42:43 +08:00
parent 63952e9dc0
commit 42e44f9000
3 changed files with 36 additions and 1 deletions
+21
View File
@@ -184,6 +184,27 @@ class LoginMixin(WechatAPIClientBase):
else:
self.error_handler(json_resp)
async def heartbeat_long(self) -> bool:
"""发送心跳包。
Returns:
bool: 成功返回True,否则返回False
Raises:
UserLoggedOut: 如果未登录时调用
根据error_handler处理错误
"""
if not self.wxid:
raise UserLoggedOut("请先登录")
async with aiohttp.ClientSession() as session:
response = await session.post(f'http://{self.ip}:{self.port}/api/Login/HeartBeatLong?wxid={self.wxid}')
json_resp = await response.json()
if json_resp.get("Success"):
return True
else:
self.error_handler(json_resp)
@staticmethod
def create_device_name() -> str:
"""生成一个随机的设备名。