diff --git a/middlewares/baiducloud.py b/middlewares/baiducloud.py index a5cec5ce..e87f235c 100644 --- a/middlewares/baiducloud.py +++ b/middlewares/baiducloud.py @@ -64,6 +64,8 @@ async def check_and_update_access_token(self): await self.get_access_token() async def get_conclusion(self, text: str): + await self.check_and_update_access_token() + baidu_url = f"https://aip.baidubce.com/rest/2.0/solution/v1/text_censor/v2/user_defined" \ f"?access_token={self.access_token}" headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json'}