feat: 添加系统配置,更新验证码接口

This commit is contained in:
2025-02-12 23:25:19 +08:00
parent 46e9e79670
commit 2f28d6d5e0
15 changed files with 362 additions and 35 deletions

View File

@@ -6,20 +6,20 @@
# @Software : PyCharm
# @Comment : 本程序日志装饰器定义
import json
import time
from datetime import datetime
from functools import wraps, lru_cache
from async_lru import alru_cache
from typing import Optional, Literal
import urllib
import hashlib
import ipaddress
import json
import time
import urllib
from functools import wraps
from typing import Optional, Literal
from async_lru import alru_cache
from fastapi import Request
from fastapi.responses import ORJSONResponse, UJSONResponse, JSONResponse
from user_agents import parse
from httpx import AsyncClient
from user_agents import parse
from config.constant import BusinessType
from config.env import AppConfig, MapConfig
from controller.login import LoginController
@@ -226,7 +226,7 @@ async def get_ip_location(ip: str) -> str:
# 将sn参数添加到请求中
queryStr = queryStr + "&sn=" + sn
url = host + queryStr
async with AsyncClient(headers=headers,timeout=60) as client:
async with AsyncClient(headers=headers, timeout=60) as client:
response = await client.get(url)
if response.status_code == 200:
result = response.json()
@@ -239,4 +239,3 @@ async def get_ip_location(ip: str) -> str:
except ValueError:
# 如果IP地址格式无效
return "未知地点"