Vue-axios

关于axios
axios中,get请求和post请求携带参数的方式不一样,具体如下:

axios.get(url, {
        params: {
            id: 123456
        }
    }).then(res => {})
axios.post(url, {
        id: 123456

post请求传参 需要 使用内置库QS来解决

  import qs from "qs"
   axios.post('http://192.168.33.10:8009/api/token', 
   qs.stringify({
    email: email,
    password: pass,
  }))
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });
原文地址:https://www.cnblogs.com/water-no-moon/p/12848649.html