zhaoqingang
2024-12-27 05592050e0f6e87b63952fc58117cb2f112d31ae
app/service/bisheng.py
@@ -26,7 +26,7 @@
        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:
@@ -35,7 +35,10 @@
                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()
@@ -90,10 +93,10 @@
                        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 = [