fix base url

This commit is contained in:
Aditya Siregar 2025-09-13 17:09:04 +07:00
parent 54d8ff3444
commit 84454e66dc

View File

@ -6,7 +6,7 @@ const getToken = () => {
} }
export const api = axios.create({ export const api = axios.create({
baseURL: 'https://enaklo-pos-be.altru.id/api/v1', baseURL: 'https://api-pos.apskel.id/api/v1',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
@ -33,8 +33,6 @@ api.interceptors.response.use(
const currentPath = window.location.pathname const currentPath = window.location.pathname
if (status === 401 && !currentPath.endsWith('/login')) { if (status === 401 && !currentPath.endsWith('/login')) {
localStorage.removeItem('user')
localStorage.removeItem('authToken')
window.location.href = '/login' window.location.href = '/login'
} }
@ -49,3 +47,4 @@ api.interceptors.response.use(
return Promise.reject(error) return Promise.reject(error)
} }
) )