common.api.js 1.0 KB

1234567891011121314151617181920212223242526
  1. const http = uni.$u.http
  2. // 单文件上传
  3. export const uploadFile = (filePath, custom = {}) => http.upload('upload/pictureLocal', {
  4. // #ifdef MP-ALIPAY
  5. fileType: 'image/video/audio', // 仅支付宝小程序,且必填。
  6. // #endif
  7. filePath,
  8. custom,
  9. name: 'file'
  10. })
  11. // 多文件上传
  12. export const uploadMultiFile = (files, custom = {}) => http.upload('upload/pictureLocal', {
  13. // #ifdef MP-ALIPAY
  14. fileType: 'image/video/audio', // 仅支付宝小程序,且必填。
  15. // #endif
  16. files,
  17. custom
  18. })
  19. // 版本更新
  20. export const updateApp = (params, custom = {}) => http.post('info/version/query', params, { custom: { ...custom, type: 'json' } })
  21. // app使用时长统计
  22. export const heartTracking = (params, custom = {}) => http.post('tracking/duration', params, { custom: { ...custom, type: 'json' } })