index.js 614 B

123456789101112131415161718192021222324252627
  1. const {
  2. http
  3. } = uni.$u
  4. // 请求首页顶部轮播
  5. export const getCode = (params, config = {}) => http.post('/api/sms/send', params, config)
  6. export const getImage = (params, config = {}) => http.post('/api/getImage', params, config)
  7. export const getActivityDataDetailReq = (params, config = {}) => {
  8. let apiUrl = '/api/users/getActivityDataDetail'
  9. Object.keys(params).forEach((item, index) => {
  10. if (index == 0) {
  11. apiUrl += `?${item}=${params[item]}`
  12. } else {
  13. apiUrl += `&${item}=${params[item]}`
  14. }
  15. })
  16. console.log('处理后的apiUrl', apiUrl);
  17. return http.get(apiUrl, params, config)
  18. }