feat: silent wechat login, marketing tab optimization, admin page foundation

- Add silent WeChat login for MP/browser environments
- Fix Python 3.6 compatibility (remove typing.Annotated usage)
- Marketing page: tab-based content generation with category support
- Translate page: add auto-detect language default
- Homepage: add TTS playback, announcement ticker, remove redundant quick-actions
- Fix FAB button overlap with custom tabbar on customers/quotation pages
- Make openai/anthropic imports lazy for Python 3.6 compat
This commit is contained in:
TradeMate Dev
2026-05-14 00:30:48 +08:00
parent f70dd24c7d
commit 23a31f7c00
30 changed files with 485 additions and 269 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.ext.asyncio import AsyncSession
from typing import Annotated, Optional
from typing import Optional
from pydantic import BaseModel
from app.database import get_db
from app.services.push import PushService
@@ -20,7 +20,7 @@ class DeviceRegisterRequest(BaseModel):
async def register_device(
data: DeviceRegisterRequest,
user_id: str = Depends(get_current_user_id),
db: Annotated[AsyncSession, Depends(get_db)] = None,
db: AsyncSession = Depends(get_db),
):
service = PushService(db)
device = await service.register_device(
@@ -41,7 +41,7 @@ async def register_device(
async def unregister_device(
data: dict,
user_id: str = Depends(get_current_user_id),
db: Annotated[AsyncSession, Depends(get_db)] = None,
db: AsyncSession = Depends(get_db),
):
client_id = data.get("client_id")
if not client_id:
@@ -56,7 +56,7 @@ async def unregister_device(
@router.get("/devices")
async def list_devices(
user_id: str = Depends(get_current_user_id),
db: Annotated[AsyncSession, Depends(get_db)] = None,
db: AsyncSession = Depends(get_db),
):
service = PushService(db)
devices = await service.get_user_devices(user_id)