12345678910111213141516171819202122 |
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- from app.admin.schema.token import GetLoginToken
- from app.admin.schema.auth import AuthGenTokenParam
- from common.security.jwt_call_center import create_access_token
- class AuthService:
- async def gen_token(
- self, pk: int
- ) -> GetLoginToken:
- user_id = pk
- a_token = await create_access_token(str(user_id))
- data = GetLoginToken(
- access_token=a_token.access_token,
- access_token_expire_time=a_token.access_token_expire_time,
- )
- return data
- auth_service: AuthService = AuthService()
|