添加axios 添加全局配置

This commit is contained in:
2020-09-24 11:21:42 +08:00
parent 4f571bfc47
commit 4fbf1353da
4 changed files with 18 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
import axios from 'axios'
axios.defaults.baseURL = 'https://api.example.com';
axios.defaults.headers.common['Authorization'] = 'token';
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
export default axios