feat: 添加系统配置、审计中心、通知中心、文件管理模块
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"""
|
||||
认证API
|
||||
"""
|
||||
|
||||
from typing import Dict, Any
|
||||
from httpx import AsyncClient, Response
|
||||
from .base_api import BaseAPI
|
||||
|
||||
|
||||
class AuthAPI(BaseAPI):
|
||||
"""认证API"""
|
||||
|
||||
def __init__(self, client: AsyncClient):
|
||||
super().__init__(client, "/api/auth")
|
||||
|
||||
async def login(self, username: str, password: str) -> Response:
|
||||
"""用户登录"""
|
||||
return await self.post("/login", json={
|
||||
"username": username,
|
||||
"password": password
|
||||
})
|
||||
|
||||
async def refresh_token(self, refresh_token: str) -> Response:
|
||||
"""刷新token"""
|
||||
return await self.post("/refresh", json={
|
||||
"refreshToken": refresh_token
|
||||
})
|
||||
|
||||
async def logout(self, token: str) -> Response:
|
||||
"""用户登出"""
|
||||
return await self.post("/logout", headers={
|
||||
"Authorization": f"Bearer {token}"
|
||||
})
|
||||
Reference in New Issue
Block a user