fix(excel):change

This commit is contained in:
shahzeydyfah
2026-06-10 00:31:45 +03:30
parent d1f6c1830f
commit 759c2216c6
8 changed files with 768 additions and 674 deletions
+3 -3
View File
@@ -23,9 +23,8 @@ async def validate_token(_input: ValidateTokenInput):
_cache_auth = await redis_get(f'{conf.auth.cache_prefix_key}{_cache_key}', conf.database.get('auth_redis'))
if not _cache_auth:
client = httpx.AsyncClient()
headers = {'Content-Type': 'application/json', }
result = await client.request('POST', conf.auth.url, json=_input.dict(), headers=headers)
headers = {'Content-Type': 'application/json', 'Authorization':'Bearer '+_input.token}
result = await client.request('GET', conf.auth.url, json=_input.dict(), headers=headers)
export = result.text
if 'application/json' in result.headers['content-type']:
export = result.json()
@@ -35,6 +34,7 @@ async def validate_token(_input: ValidateTokenInput):
if 'v2' in conf.auth.url:
export = export.get('data')
print(export)
await redis_set(f'{conf.auth.cache_prefix_key}{_cache_key}', export, conf.database.get('auth_redis'),
ex=conf.auth.cache_ttl)
+3 -3
View File
@@ -8,12 +8,12 @@ from core.models.base import BaseModel
class UserModel(BaseModel):
id: Optional[Union[uuid.UUID, str]] = Field(alias='_id')
id: Optional[Union[uuid.UUID, str, int]] = Field(alias='_id')
username: Optional[str]
mobile: Optional[str]
name: Optional[str]
first_name: Optional[str]
last_name: Optional[str]
fname: Optional[str]
lname: Optional[str]
is_su: Optional[bool]
unit: Optional[str]
avatar: Optional[str]