From f2806903374b4be8f8a974e22bd177dbc4e90798 Mon Sep 17 00:00:00 2001 From: Akimio521 Date: Thu, 31 Oct 2024 21:18:54 +0800 Subject: [PATCH] =?UTF-8?q?perfect(AlistClient):=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=96=B9=E6=B3=95=E8=A3=85=E9=A5=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E5=92=8C=E5=AF=86=E7=A0=81=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E8=A2=AB=E6=84=8F=E5=A4=96=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/alist/v3/client.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app/api/alist/v3/client.py b/app/api/alist/v3/client.py index a18c162..b08759a 100644 --- a/app/api/alist/v3/client.py +++ b/app/api/alist/v3/client.py @@ -37,8 +37,8 @@ def __init__(self, url: str, username: str, password: str) -> None: url = "https://" + url self.url = url.rstrip("/") - self.username = str(username) - self.__password = str(password) + self.__username = str(username) + self.___password = str(password) self.__dir = "/" self.__token = { "token": "", # 令牌 token str @@ -56,6 +56,22 @@ async def __aenter__(self): async def __aexit__(self, *_): await self.__session.close() + @property + def username(self) -> str: + """ + 获取用户名 + """ + + return self.__username + + @property + def __password(self) -> str: + """ + 获取密码 + """ + + return self.___password + @property def __get_token(self) -> str: """