Compare commits

..

No commits in common. "fdcb0e12f4e9b3757c4812fa265ce3804aa8ba3d" and "7570e973b8d85dfa0e299ef99b5fdff8ac2f0126" have entirely different histories.

View File

@ -6,7 +6,8 @@ const getToken = () => {
} }
export const api = axios.create({ export const api = axios.create({
baseURL: 'https://enaklo-pos-be.altru.id/api/v1', // baseURL: 'https://enaklo-pos-be.altru.id/api/v1',
baseURL: 'http://127.0.0.1:4000/api/v1',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
@ -31,7 +32,7 @@ api.interceptors.response.use(
error => { error => {
const status = error.response?.status const status = error.response?.status
if (status === 401 && !currentPath.endsWith('/login')) { if (status === 401) {
localStorage.removeItem('user') localStorage.removeItem('user')
localStorage.removeItem('authToken') localStorage.removeItem('authToken')
window.location.href = '/login' window.location.href = '/login'