chore/ 删除无用文件

This commit is contained in:
Kevin
2026-03-19 14:36:14 +08:00
parent 2f60858c9c
commit c6e07ce5ca
135 changed files with 2111 additions and 4510 deletions

View File

@@ -162,9 +162,7 @@ class AuthService:
device_info: str = "",
) -> dict:
"""Refresh access token. Returns {access_token, refresh_token}."""
token_record = await repo.get_refresh_token_by_token(
refresh_token, self._db
)
token_record = await repo.get_refresh_token_by_token(refresh_token, self._db)
if not token_record:
raise AuthError("无效的刷新令牌", "INVALID_TOKEN")
@@ -186,9 +184,7 @@ class AuthService:
async def logout(self, refresh_token: str, user_id: str) -> None:
"""Revoke a refresh token owned by the given user."""
token_record = await repo.get_refresh_token_by_token(
refresh_token, self._db
)
token_record = await repo.get_refresh_token_by_token(refresh_token, self._db)
if token_record and token_record.user_id == user_id:
token_record.is_revoked = True
await self._db.commit()
@@ -284,9 +280,7 @@ class AuthService:
new_password: str,
) -> None:
"""Reset password via SMS code."""
success, message = await self._verify_sms_code(
phone, code, "reset_password"
)
success, message = await self._verify_sms_code(phone, code, "reset_password")
if not success:
raise AuthError(message, "INVALID_SMS_CODE")
@@ -321,9 +315,7 @@ class AuthService:
code: str,
) -> User:
"""Change phone number via SMS code. Returns updated user."""
success, message = await self._verify_sms_code(
new_phone, code, "change_phone"
)
success, message = await self._verify_sms_code(new_phone, code, "change_phone")
if not success:
raise AuthError(message, "INVALID_SMS_CODE")