feat: 增加会员服务与估价模版智能体

会员服务改为固定栏目,首页在线服务不再进入报告审核。估价模版智能体可多会话制作模版并下载,下载过程显示加载状态。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-11-23 13:36:19 +08:00
1 parent 55b5a87482
commit 2074a45681
63 files changed
+6428 -461

No files matched your search

+5 -3
View File
@@ -9,7 +9,7 @@ from app.core.config import get_settings
TokenType = Literal["staff", "member", "agent"]
def create_access_token(subject: str, token_type: TokenType) -> str:
def create_access_token(subject: str, token_type: TokenType, *, version: int | None = None) -> str:
settings = get_settings()
if len(settings.jwt_secret) < 32:
raise HTTPException(
@@ -21,8 +21,10 @@ def create_access_token(subject: str, token_type: TokenType) -> str:
if token_type == "staff"
else settings.jwt_member_expire_minutes
)
expire = datetime.now(timezone.utc) + timedelta(minutes=minutes)
payload = {"sub": subject, "typ": token_type, "exp": expire}
now = datetime.now(timezone.utc)
payload = {"sub": subject, "typ": token_type, "exp": now + timedelta(minutes=minutes), "iat": now}
if version is not None:
payload["ver"] = int(version)
return jwt.encode(payload, settings.jwt_secret, algorithm="HS256")