buddhism/api/index/index.js
minimaxagent1 69c05c4911 换皮test1.3
公告,时间,背景图,已经可以使用temple/index接口进行修改
2025-08-06 14:12:33 +08:00

63 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 首页配置相关API
import { get, request } from '@/utils/request'
/**
* 获取寺庙介绍信息
* @returns {Promise} 返回寺庙介绍数据
*/
export function getTempleIndex() {
return get('/app/temple/index', {}, {
timeout: 10000,
showLoading: false
})
}
/**
* 获取首页配置
* @returns {Promise} 返回首页配置数据
*/
export function getHomeConfig() {
return get('/app/homeCfg', {}, {
timeout: 10000, // 10秒超时
showLoading: false // 不显示加载状态因为页面有自己的loading
})
}
/**
* 更新首页配置
* @param {Object} data - 首页配置数据
* @returns {Promise} 返回更新结果
*/
export function updateHomeConfig(data) {
return request({
url: '/app/homeCfg',
method: 'PUT',
data
})
}
/**
* 创建首页配置
* @param {Object} data - 首页配置数据
* @returns {Promise} 返回创建结果
*/
export function createHomeConfig(data) {
return request({
url: '/app/homeCfg',
method: 'POST',
data
})
}
/**
* 删除首页配置
* @param {string} id - 配置ID
* @returns {Promise} 返回删除结果
*/
export function deleteHomeConfig(id) {
return request({
url: `/app/homeCfg/${id}`,
method: 'DELETE'
})
}