index.js 513 B

1234567891011121314151617181920
  1. const {
  2. http
  3. } = uni.$u
  4. // 获取SKU价格
  5. // export const getGoodsPriceReq = (params, config = {}) => http.get('/api/goods/getGoodsPrice', params, config)
  6. export const getGoodsPriceReq = (params, config = {}) => {
  7. let apiUrl = '/api/goods/getGoodsPrice'
  8. Object.keys(params).forEach((item, index) => {
  9. if (index == 0) {
  10. apiUrl += `?${item}=${params[item]}`
  11. } else {
  12. apiUrl += `&${item}=${params[item]}`
  13. }
  14. })
  15. console.log('处理后的apiUrl', apiUrl);
  16. return http.get(apiUrl, params, config)
  17. }