1.axios的参数(params)

import axios from 'axios'
export function getDiscList() {
  const url = '/api/getDiscList'
  const data = Object.assign({}, commonParams, {
    plateform: 'yqq',
    hostUin: 0,
    sin: 0,
    ein: 29,
    sortId: 5,
    needNewCode: 0,
    categoryId: 10000000,
    rnd: Math.random(),
    format: 'json'
  })
  return axios.get(url, {
    params: data
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}

axios请求中的参数(params)与路径变量

在浏览器中的显示方式

axios请求中的参数(params)与路径变量

2.路径变量(就是请求不同的路径)

axios请求中的参数(params)与路径变量

axios请求中的参数(params)与路径变量

浏览器中的显示形式

axios请求中的参数(params)与路径变量

相关文章:

  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2022-01-01
猜你喜欢
  • 2021-05-13
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案