Axios.default.baseURL doesn't work?

main.js code is as follows:

import axios from "axios"
axios.default.baseURL = "http://218.17.186.XXX:9104"

component code is as follows:

mounted:function(){
    //
    axios.get("/account/list",{
        headers : { //token  
            Authorization : getCookie("token")  
        }  
    })
    .then( res =>{
        //
        if( res.data.status == 1){
            this.infoData = res.data.data;
        }
    })
}

you can render data normally without axios.default.baseURL interface. After using axios.default.baseURL, you can tell why you can"t find it.


should be defaults ?

Menu