|
|
@@ -1,5 +1,4 @@
|
|
|
import axios from 'axios'
|
|
|
-import { uuidv4 } from '/@/utils/uuid'
|
|
|
import { CURRENT_CONFIG } from './config'
|
|
|
import { message } from 'ant-design-vue'
|
|
|
import router from '/@/router'
|
|
|
@@ -7,22 +6,20 @@ import { ELocalStorageKey, ERouterName, EUserType } from '/@/types/enums'
|
|
|
export * from './type'
|
|
|
|
|
|
const REQUEST_ID = 'X-Request-Id'
|
|
|
+
|
|
|
function getAuthToken() {
|
|
|
return localStorage.getItem(ELocalStorageKey.Token)
|
|
|
}
|
|
|
|
|
|
const instance = axios.create({
|
|
|
- // withCredentials: true,
|
|
|
headers: {
|
|
|
'Content-Type': 'application/json',
|
|
|
},
|
|
|
- // timeout: 12000,
|
|
|
})
|
|
|
|
|
|
instance.interceptors.request.use(
|
|
|
config => {
|
|
|
config.headers[ELocalStorageKey.Token] = getAuthToken()
|
|
|
- // config.headers[REQUEST_ID] = uuidv4()
|
|
|
config.baseURL = CURRENT_CONFIG.baseURL
|
|
|
return config
|
|
|
},
|