common.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /**
  2. * 通用API接口
  3. */
  4. import { get, post, uploadFile } from '@/utils/request.js';
  5. /**
  6. * 获取轮播图列表
  7. */
  8. export function getBannerListApi() {
  9. return get('/common/banner');
  10. }
  11. /**
  12. * 获取通知公告列表
  13. */
  14. export function getNoticeListApi(params) {
  15. return get('/common/notice', params);
  16. }
  17. /**
  18. * 获取新闻列表
  19. */
  20. export function getNewsListApi(params) {
  21. return get('/common/news', params);
  22. }
  23. /**
  24. * 获取字典数据
  25. */
  26. export function getDictDataApi(dictType) {
  27. return get(`/common/dict/${dictType}`);
  28. }
  29. /**
  30. * 文件上传
  31. */
  32. export function uploadFileApi(filePath, options = {}) {
  33. return uploadFile('/common/upload', filePath, {
  34. name: 'file',
  35. ...options,
  36. });
  37. }
  38. /**
  39. * 获取系统配置
  40. */
  41. export function getConfigApi() {
  42. return get('/common/config');
  43. }
  44. /**
  45. * 意见反馈
  46. */
  47. export function feedbackApi(data) {
  48. return post('/common/feedback', data);
  49. }
  50. /**
  51. * 获取版本信息
  52. */
  53. export function getVersionApi() {
  54. return get('/common/version');
  55. }
  56. /**
  57. * 检查更新
  58. */
  59. export function checkUpdateApi() {
  60. return get('/common/check-update');
  61. }