feat: add rbac-backed settings modules
This commit is contained in:
@@ -18,6 +18,11 @@ from fastapi_modules.fastapi_leaudit.services.authService import IAuthService
|
||||
class AuthServiceImpl(IAuthService):
|
||||
"""认证服务实现。"""
|
||||
|
||||
@staticmethod
|
||||
def _naive_utcnow() -> datetime:
|
||||
"""返回适配 timestamp without time zone 的 UTC 时间。"""
|
||||
return datetime.utcnow()
|
||||
|
||||
async def PasswordLogin(self, Sub: str, Password: str) -> LoginTokenVO:
|
||||
"""账密登录。
|
||||
|
||||
@@ -112,7 +117,7 @@ class AuthServiceImpl(IAuthService):
|
||||
"ou_id": OuId or user.get("ou_id") or "",
|
||||
"ou_name": OuName or user.get("ou_name") or "",
|
||||
"is_leader": IsLeader if IsLeader is not None else user.get("is_leader"),
|
||||
"now": datetime.now(timezone.utc),
|
||||
"now": self._naive_utcnow(),
|
||||
"id": user["id"],
|
||||
},
|
||||
)
|
||||
@@ -133,7 +138,7 @@ class AuthServiceImpl(IAuthService):
|
||||
"ou_id": OuId or "",
|
||||
"ou_name": OuName or "",
|
||||
"is_leader": bool(IsLeader),
|
||||
"now": datetime.now(timezone.utc),
|
||||
"now": self._naive_utcnow(),
|
||||
},
|
||||
)
|
||||
user_id = created.scalar_one()
|
||||
|
||||
Reference in New Issue
Block a user