import request from '@/utils/request' // 处理富文本内容截取 export const formatPolicyContext = (context, maxLength = 100) => { if (!context) return '' // 移除HTML标签 const plainText = context.replace(/<[^>]+>/g, '') return plainText.length > maxLength ? plainText.substring(0, maxLength) + '...' : plainText } // 政策法规 API export const PolicyApi = { /** * 查询政策法规分页 * @param {Object} params */ getPolicyPage: (params) => { return request({ url: `/system/policy/page`, method: 'GET', params }) }, // 查询政策法规详情 getPolicy: (id) => { return request({ url: `/system/policy/get?id=` + id,method: 'GET' }) }, }