axios中文官网地址

GET 请求

axios.get('接口url', {
        params: {
          携带参数
        },
        headers: {
          'content-type': 'application/x-www-form-urlencoded',
          'Authorization': this.$store.getters.token // 请求头配置
        }
      })
        .then((res) => {
          console.log('回调参数' + res)
        })
        .catch((error) => {
          console.log('异常抛出' + error)
        })
文章目录