HomeLease/api/article/article.js
2025-09-01 16:11:34 +08:00

104 lines
2.2 KiB
JavaScript
Raw Permalink 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.

import request from '@/utils/request'
/**
* 获取条款和隐私政策
* @param {Object} params - 查询参数
* @param {string} params.type - 类型 5:服务条款 6:隐私条款
* @param {string} params.status - 状态
* @returns {Promise} 返回条款数据
*/
export function getArticleByType(params = {}) {
return request({
url: '/app/article/listByType',
method: 'GET',
params: {
status: 1,
...params,
},
})
}
/**
* 获取服务条款
* @returns {Promise} 返回服务条款数据
*/
export function getServiceTerms() {
return request({
url: '/app/article/getNew',
method: 'GET',
params: {
appId: '1',
type: '1', // 1:服务条款
pageNum: '1',
pageSize: '1',
orderByColumn: 'ba.createTime',
isAsc: 'descending',
},
})
}
/**
* 获取隐私政策
* @returns {Promise} 返回隐私政策数据
*/
export function getPrivacyPolicy() {
return request({
url: '/app/article/getNew',
method: 'GET',
params: {
appId: '1',
type: '2', // 2:隐私政策
pageNum: '1',
pageSize: '1',
orderByColumn: 'ba.createTime',
isAsc: 'descending',
},
})
}
/**
* 获取最新公告
* @param {Object} params - 查询参数
* @param {string} params.type - 类型4表示公告
* @returns {Promise} 返回最新公告数据
*/
export function getNewAnnouncement(params = {}) {
return request({
url: '/app/article/getNew',
method: 'GET',
params: {
type: '4',
pageNum: '1',
pageSize: '1',
orderByColumn: 'ba.createTime',
isAsc: 'descending',
...params,
},
})
}
/**
* 获取文章列表
* @param {Object} params - 查询参数
* @param {string} params.appId - 应用ID
* @param {string} params.pageNum - 页码
* @param {string} params.pageSize - 每页数量
* @param {string} params.orderByColumn - 排序字段
* @param {string} params.isAsc - 升序/降序
* @returns {Promise} 返回文章列表数据
*/
export function getArticleList(params = {}) {
return request({
url: '/app/article/list',
method: 'GET',
params: {
appId: '1',
pageNum: '1',
pageSize: '10',
orderByColumn: 'create_time',
isAsc: 'descending',
...params,
},
})
}