push
This commit is contained in:
23
lib/paas/config/router.config.ts
Normal file
23
lib/paas/config/router.config.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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';
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user