refactor(backend): 重命名后端项目为 gym-manage-api,修改包名为 cn.novalon.gym.manage
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
认证 API 客户端
|
||||
"""
|
||||
|
||||
from httpx import AsyncClient
|
||||
|
||||
|
||||
class AuthAPI:
|
||||
"""认证 API 客户端"""
|
||||
|
||||
def __init__(self, client: AsyncClient):
|
||||
self.client = client
|
||||
|
||||
async def login(self, username: str, password: str):
|
||||
"""登录"""
|
||||
return await self.client.post('/api/auth/login', json={
|
||||
'username': username,
|
||||
'password': password
|
||||
})
|
||||
|
||||
async def register(self, username: str, password: str, email: str):
|
||||
"""注册"""
|
||||
return await self.client.post('/api/auth/register', json={
|
||||
'username': username,
|
||||
'password': password,
|
||||
'email': email
|
||||
})
|
||||
|
||||
async def logout(self):
|
||||
"""登出"""
|
||||
return await self.client.post('/api/auth/logout')
|
||||
Reference in New Issue
Block a user