api.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { getToken } from '@/util';
  2. const { http } = uni.$u
  3. // 获取菜单
  4. export const fetchMenu = (params, config = {}) => http.post(
  5. '/ebapi/public_api/index', params, config);
  6. export const fetchContentInfo = (params) => http.get('/cp/contentInfo/list',
  7. { params });
  8. export const fetchContentDetail = (id) => http.get(`/cp/contentInfo/${id}`);
  9. export const fetchMsgList = (params) => http.get('/cp/msg/list',
  10. { params });
  11. export const fetchViewCfgList = (params) => http.get('/cp/viewcfg/list',
  12. { params });
  13. export const fetchFileList = (params) => http.get('/cp/fileInfo/list',
  14. { params });
  15. export const putUsrRegist = (params) => {
  16. const token = getToken();
  17. if (!token) {
  18. return Promise.reject('未登录');
  19. }
  20. return http.post('/cp/usr/regist', params, {
  21. header: {
  22. Authorization: `Bearer ${token}`,
  23. },
  24. });
  25. };
  26. export const fetchEnterpriseList = (params = {}) => http.get(
  27. '/cp/enterprise/list', {
  28. params: {
  29. pageNum: 1,
  30. pageSize: 999,
  31. ...params,
  32. },
  33. header: {
  34. Authorization: `Bearer ${getToken()}`,
  35. },
  36. });
  37. export const fetchEnterpriseTripList = (params = {}) => http.get(
  38. '/cp/enterpriseTripInfo/list', {
  39. params: {
  40. pageNum: 1,
  41. pageSize: 999,
  42. ...params,
  43. },
  44. header: {
  45. Authorization: `Bearer ${getToken()}`,
  46. },
  47. });