| | |
| | | else: |
| | | return {} |
| | | |
| | | async def register(self, username: str, password: str): |
| | | async def register(self, username: str, password: str, token:str=""): |
| | | public_key = await self.get_public_key_api() |
| | | password = BishengCrypto(public_key, settings.PRIVATE_KEY).encrypt(password) |
| | | async with httpx.AsyncClient() as client: |
| | |
| | | json={"user_name": username, "password": password}, |
| | | headers={'Content-Type': 'application/json'} |
| | | ) |
| | | return self._check_response(response) |
| | | res = self._check_response(response) |
| | | if isinstance(res, dict): |
| | | res["id"] = res.get("user_id") |
| | | return res |
| | | |
| | | async def login(self, username: str, password: str) -> str: |
| | | public_key = await self.get_public_key_api() |
| | |
| | | name = message_json['query'] |
| | | elif 'report_name' in message_json: |
| | | name = message_json['report_name'] |
| | | except json.JSONDecodeError: |
| | | except Exception as e: |
| | | pass |
| | | if not name: |
| | | name = item.get("flow_name") |
| | | name = item.get("flow_name") |
| | | return name[:50] |
| | | |
| | | result = [ |