You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
753 B

7 months ago
import Cookies from 'js-cookie';
export const routerConfig = {
login: () => {
sessionStorage.clear();
if (window.location.href.includes('localhost')) {
window.location.href = `${import.meta.env.VITE_PUBLIC_PATH}login`;
} else if (window.location.href.includes('http://100.68.2.97:4200/')) {
window.location.href = `${import.meta.env.VITE_PUBLIC_PATH}login`;
} else {
window.location.href = `${import.meta.env.VITE_PUBLIC_PATH}login`;
}
},
logout: () => {
Cookies.remove('nervsid');
sessionStorage.clear();
if (window.location.href.includes('localhost')) {
window.location.href = `${import.meta.env.VITE_PUBLIC_PATH}login`;
} else {
window.location.href = '/logout';
}
},
};