24 lines
724 B
Python
24 lines
724 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.orm import Session
|
|
|
|
from app.db import get_db
|
|
from app.models.content import settings_view
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/settings")
|
|
def read_public_settings(db: Session = Depends(get_db)) -> dict:
|
|
# 只返回门户展示字段。上传上限和登录锁定参数留在管理端。
|
|
data = settings_view(db)
|
|
return {
|
|
"siteName": data["site_name"],
|
|
"logoUrl": data["logoUrl"],
|
|
"bannerUrls": data["bannerUrls"],
|
|
"icpText": data["icp_text"],
|
|
"policeText": data["police_text"],
|
|
"friendLinks": data["friend_links"],
|
|
"linkCirea": data["link_cirea"],
|
|
"linkHousing": data["link_housing"],
|
|
}
|