整合前端仓库并保留提交历史
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import request from '~/utils/request'
|
||||
import type { LinkItem, AdvertisementItem, NavigationItem, SiteData } from './types'
|
||||
|
||||
/**
|
||||
* 获取友情链接列表
|
||||
*/
|
||||
export function getLinks(params?: { type?: string }): Promise<LinkItem[]> {
|
||||
return request.get('/site/link', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有友情链接
|
||||
*/
|
||||
export function getAllLinks(): Promise<LinkItem[]> {
|
||||
return request.get('/site/link/all')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告位信息
|
||||
*/
|
||||
export function getAdvertisements(params?: { type?: string }): Promise<AdvertisementItem[]> {
|
||||
return request.get('/site/ads', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导航菜单列表
|
||||
*/
|
||||
export function getNavigationList(): Promise<NavigationItem[]> {
|
||||
return request.get('/site/nav')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点首页数据(广告、导航、友情链接等)
|
||||
*/
|
||||
export function getSiteData(): Promise<SiteData> {
|
||||
return request.get('/site/site-data')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 Web 分组所有配置
|
||||
* 一次性获取前台站点设置、搜索配置、统计分析配置等
|
||||
*/
|
||||
export function getWebGroupConfigs(): Promise<Record<string, any>> {
|
||||
return request.get('/system/config/group/web')
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据配置编码获取单一配置
|
||||
* @param code 配置编码,如 web_site_setting, web_payment_config 等
|
||||
*/
|
||||
export function getConfigByCode(code: string): Promise<Record<string, any>> {
|
||||
return request.get(`/system/config/code/${code}`)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 站点首页模块相关类型定义
|
||||
*/
|
||||
|
||||
/**
|
||||
* 友情链接项
|
||||
*/
|
||||
export interface LinkItem {
|
||||
id: number
|
||||
name: string
|
||||
url: string
|
||||
logo?: string
|
||||
description?: string
|
||||
category?: string
|
||||
sort: number
|
||||
target?: string
|
||||
click_count?: number
|
||||
enabled: number
|
||||
created_at: number
|
||||
updated_at: number
|
||||
deleted_at: number | null
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告项
|
||||
*/
|
||||
export interface AdvertisementItem {
|
||||
id: number
|
||||
title: string
|
||||
link: string
|
||||
image: string
|
||||
description?: string
|
||||
sort: number
|
||||
enabled: number
|
||||
start_time: number
|
||||
end_time: number
|
||||
created_at: number
|
||||
updated_at: number
|
||||
deleted_at: number | null
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航菜单项
|
||||
*/
|
||||
export interface NavigationItem {
|
||||
id: number
|
||||
title: string
|
||||
url: string
|
||||
icon?: string
|
||||
code: string | null
|
||||
sort: number
|
||||
enabled: number
|
||||
is_show: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 站点首页数据
|
||||
*/
|
||||
export interface SiteData {
|
||||
advertisements: AdvertisementItem[]
|
||||
navigation: NavigationItem[]
|
||||
links: LinkItem[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索配置项
|
||||
*/
|
||||
export interface SearchConfig {
|
||||
keyword: string // 搜索引擎关键字
|
||||
keyword_enabled: number // 是否启用关键字搜索 (0/1)
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计分析配置项
|
||||
*/
|
||||
export interface AnalyticsConfig {
|
||||
baidu_tongji_code: string // 百度统计代码
|
||||
baidu_tongji_enabled: number // 是否启用百度统计 (0/1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user