/** * 前台公开 API(无需 token) */ import { http, type Paginated } from './api'; import type { Banner, Manual, ManualTreeNode, News, NewsCategory, Product, ProductCategory, SiteConfig, Team, } from './types'; export const publicApi = { getSiteConfig: () => http.get('/public/site-config'), getBanners: () => http.get('/public/banner'), getProductCategories: () => http.get('/public/product-category'), getProducts: (params: Record = {}) => http.get>('/public/product', { params }), getProductDetail: (id: number) => http.get(`/public/product/${id}`), getNewsCategories: () => http.get('/public/news-category'), getNews: (params: Record = {}) => http.get>('/public/news', { params }), getNewsDetail: (id: number) => http.get(`/public/news/${id}`), getTeam: () => http.get('/public/team'), submitMessage: (payload: { name: string; phone: string; email?: string; content: string; }) => http.post('/public/message', payload), // ---------- 使用手册 ---------- getManualTree: () => http.get('/public/manual/tree'), getManualDetail: (id: number) => http.get(`/public/manual/${id}`), };