Upstream sync
This commit is contained in:
@@ -6,6 +6,9 @@ const Instance = () => {
|
||||
const apiUrl = process.env.NODE_ENV === 'production'
|
||||
? 'https://portal-api.bcbsinstitute.com'
|
||||
: 'https://portal-api.dev.bcbsinstitute.com';
|
||||
|
||||
// const apiUrl = 'http://localhost:5100';
|
||||
|
||||
window.localStorage.setItem('App', '8a266a40-ed2e-4be2-bdfc-459a507bf02e');
|
||||
|
||||
let instance = axios.create({
|
||||
@@ -61,11 +64,25 @@ const Instance = () => {
|
||||
return setToken(token);
|
||||
};
|
||||
|
||||
const getAPIUrl = (url) => {
|
||||
if (!url) {
|
||||
return instance;
|
||||
} else {
|
||||
const token = getCookie('token');
|
||||
return axios.create({
|
||||
baseURL: url,
|
||||
timeout: 60000,
|
||||
headers: { App: window.localStorage.getItem('App'), Token: `Bearer ${token}`, Token: `Bearer ${token}` },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const getRawConn = () => {
|
||||
const token = getCookie('token');
|
||||
if (token && token !== null && token !== '') {
|
||||
return instance;
|
||||
}
|
||||
|
||||
window.location.href = '/#/login';
|
||||
return null;
|
||||
};
|
||||
@@ -80,6 +97,7 @@ const Instance = () => {
|
||||
getConnection,
|
||||
setToken,
|
||||
getRawConn,
|
||||
getAPIUrl,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user