| | |
| | | else: |
| | | return {} |
| | | |
| | | async def chat_ping(self, url, params, headers): |
| | | res = await self.http_get(url, params, headers) |
| | | if res.status_code != 200: |
| | | return 0 |
| | | if res.json().get("code") == "unauthorized" or res.json().get("code") == 401: |
| | | return 0 |
| | | return 200 |
| | | |
| | | |
| | | async def chat_post(self, url, data, headers): |
| | | |
| | | res = await self.http_post(url, data, headers) |
| | |
| | | return res.json() |
| | | else: |
| | | return {} |
| | | |
| | | async def chat_ping(self, url, params, headers): |
| | | res = await self.http_get(url, params, headers) |
| | | if res.status_code != 200: |
| | | return 0 |
| | | if res.json().get("code") == "unauthorized" or res.json().get("code") == 401: |
| | | return 0 |
| | | return 200 |
| | | |
| | | async def chat_login(self, url, data, headers): |
| | | |
| | |
| | | else: |
| | | return {} |
| | | |
| | | async def chat_upload(self, url, files, data, headers): |
| | | |
| | | res = await self.http_upload_file(url, headers=headers, files=files, data=data) |
| | | if res.status_code == 200 or res.status_code == 201: |
| | | return res.json() |
| | | else: |
| | | return {} |
| | | |
| | | |
| | | @staticmethod |
| | | async def password_encrypt(password): |