你去看下axios文档吧.https://github.com/mzabriskie...axios.create是返回一个axios实例.按照你这样的话实际是 config.get() 如果你想全局配置而不是生成一个实例的话 axios.defaults.baseURL = 'https://api.example.com'; axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
你去看下axios文档吧.https://github.com/mzabriskie...
axios.create是返回一个axios实例.
按照你这样的话
实际是
如果你想全局配置而不是生成一个实例的话