first commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import service from '@/utils/request'
|
||||
|
||||
// 获取站点资讯顶部4篇文章
|
||||
export const getNewsCenterTop4 = async () => {
|
||||
const response = await service.get('index/newscentertop4')
|
||||
return response.data
|
||||
}
|
||||
|
||||
//点赞增加
|
||||
export const addLike = async (id: number | string) => {
|
||||
const response = await service.post(`index/articleLikes/${id}`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
// 点赞减少
|
||||
export const reduceLike = async (id: number | string) => {
|
||||
const response = await service.post(`index/articleUnlikes/${id}`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
//阅读增加
|
||||
export const addViews = async (id: number | string) => {
|
||||
const response = await service.post(`index/views/${id}`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import service from '@/utils/request'
|
||||
|
||||
// 获取前端导航
|
||||
export const getHeadMenu = async () => {
|
||||
const response = await service.get('index/headmenu')
|
||||
return response.data
|
||||
}
|
||||
|
||||
// 根据路径获取单页内容
|
||||
export const getOnePageByPath = async (path: string) => {
|
||||
const response = await service.get(`index/onepage/${encodeURIComponent(path)}`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
// 获取前端底部数据
|
||||
export const getFooterData = async () => {
|
||||
const response = await service.get('index/footerdata')
|
||||
return response.data
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import service from '@/utils/request'
|
||||
|
||||
// 获取站点新闻
|
||||
export const getCompanyNews = async (page: number = 1, limit: number = 10) => {
|
||||
const response = await service.get('index/companynews', {
|
||||
params: { page, limit }
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
|
||||
// 获取金蝶新闻
|
||||
export const getKingdeeNews = async (page: number = 1, limit: number = 10) => {
|
||||
const response = await service.get('index/kingdeenews', {
|
||||
params: { page, limit }
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
|
||||
// 获取技术中心
|
||||
export const getTechnologyCenter = async (page: number = 1, limit: number = 10, categoryId?: number) => {
|
||||
const params: any = { page, limit }
|
||||
if (categoryId) {
|
||||
params.category_id = categoryId
|
||||
}
|
||||
const response = await service.get('index/technologyCenter', {
|
||||
params
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
|
||||
// 获取技术中心分类
|
||||
export const getTechnologyCategories = async () => {
|
||||
const response = await service.get('index/technologyCategories')
|
||||
return response.data
|
||||
}
|
||||
|
||||
// 获取金蝶新闻详情
|
||||
export const getKingdeeNewsDetail = async (id: number | string) => {
|
||||
const response = await service.get(`index/kingdeenews/detail/${id}`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
// 获取站点新闻详情
|
||||
export const getCompanyNewsDetail = async (id: number | string) => {
|
||||
const response = await service.get(`index/companynews/detail/${id}`)
|
||||
return response.data
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import service from '@/utils/request'
|
||||
|
||||
// 获取模板初始化数据
|
||||
export const getThemeInit = async () => {
|
||||
const response = await service.get('index/init')
|
||||
return response.data
|
||||
}
|
||||
Reference in New Issue
Block a user