This commit is contained in:
eric
2026-03-26 02:35:13 -05:00
parent fcf990c133
commit 5306e8b5cc
32 changed files with 583 additions and 47 deletions

View File

@@ -22,10 +22,12 @@ class PocketBaseSDK:
self._client: Optional[PocketBase] = None
def get_client(self) -> PocketBase:
"""获取已认证的 PocketBase 客户端"""
"""获取已认证的 PocketBase 客户端(首次登录时认证,后续复用)"""
if self._client is None:
import logging
self._client = PocketBase(self.url)
self._client.admins.auth_with_password(self.admin_email, self.admin_password)
logging.getLogger(__name__).info("PocketBase admin 登录成功")
return self._client
def collection(self, name: str):