export default {
    name: 'App',
    data() {
      return {}
    },
    //fetch
    created() {
      fetch("/apis/test/testToken.php", {
        method:"post",
        headers:{
          token:"f4c9023jkwalkfjas2910a"
        },
        body:JSON.stringify(
          {username:"brownwang",password:"21232"}
          )
          .then(result =>{
            return result.json()
          })
          .then(data => {
            console.log(data)
          })
      })
    }
  }/config/index.js
    proxyTable: {
      '/apis':{
        target:'https://goods.footer.com',  //接口名称
        changeOrigin:true,   //是否跨域
        pathRewrite:{
          '^/apis':''   //需要rewrite重写的
        }
      }
    },import axios from 'axios'
axios.defaults.headers.common['token']='12fdafsafdfsadfsaf'
axios.defaults.headers.post["Content-type"]="application/json"
Vue.prototype.$axios=axios  export default {
    name: 'App',
    data() {
      return {}
    },
    //axios
    created() {
      this.$axios.post("/apis/test/testToken.php",
        {username:"brownwang",password:"1232"})
        .then(data=>{
          console.log(data)
        })
    }
  }