import { getToken } from '@/util'; const { http } = uni.$u // 获取菜单 export const fetchMenu = (params, config = {}) => http.post( '/ebapi/public_api/index', params, config); export const fetchContentInfo = (params) => http.get('/cp/contentInfo/list', { params }); export const fetchContentDetail = (id) => http.get(`/cp/contentInfo/${id}`); export const fetchMsgList = (params) => http.get('/cp/msg/list', { params }); export const fetchViewCfgList = (params) => http.get('/cp/viewcfg/list', { params }); export const fetchFileList = (params) => http.get('/cp/fileInfo/list', { params }); export const putUsrRegist = (params) => { const token = getToken(); if (!token) { return Promise.reject('未登录'); } return http.post('/cp/usr/regist', params, { header: { Authorization: `Bearer ${token}`, }, }); }; export const fetchEnterpriseList = (params = {}) => http.get( '/cp/enterprise/list', { params: { pageNum: 1, pageSize: 999, ...params, }, header: { Authorization: `Bearer ${getToken()}`, }, }); export const fetchEnterpriseTripList = (params = {}) => http.get( '/cp/enterpriseTripInfo/list', { params: { pageNum: 1, pageSize: 999, ...params, }, header: { Authorization: `Bearer ${getToken()}`, }, });