index.js 489 B

123456789101112131415161718192021
  1. /**
  2. * 上传文件
  3. * @param {String} filePath 要上传文件资源的路径
  4. * @param {Object} config 可覆盖默认配置
  5. */
  6. export const uploadFile = (filePath, config) => {
  7. return uni.$u.http.upload('/file/upload', {
  8. name: 'file', // 文件对应的 key
  9. filePath,
  10. timeout: 1000 * 60 * 2,
  11. ...config,
  12. });
  13. };
  14. /**
  15. * 发送验证码
  16. * @param {Object} params
  17. */
  18. export const getAuthCode = (params) => {
  19. return uni.$u.http.get('/system/common/getAuthCode', { params });
  20. };