feat: add cookie support for aixos; 🌟

新增:aixos 请求增加 cookie;
This commit is contained in:
iczer
2020-07-18 14:39:52 +08:00
parent 8688661c8c
commit b2e0accd97
5 changed files with 17 additions and 0 deletions

View File

@@ -1,4 +1,12 @@
import axios from 'axios'
import Cookie from 'js-cookie'
axios.defaults.timeout = 5000
axios.defaults.withCredentials= true
const cookies = Cookie.get()
Object.keys(cookies).forEach(key => {
axios.defaults.headers.common[key] = cookies[key]
})
const METHOD = {
GET: 'get',