console.log(axios); var obj = { name: "Utils", get(token, url, params) { return axios({ method: 'get', url, params, // get 请求时带的参数 headers: { 'auth_token': token } }).then(res => { return res; }). catch(err => { return err; }) } } obj.get("abcdefg", "www.baidu.com/api").then(res => { console.log(res); })