|
@@ -33,7 +33,11 @@ const router = createRouter({
|
|
|
|
|
|
router.beforeEach((to, from , next) => {
|
|
|
if (to.path === "/login") {
|
|
|
- next()
|
|
|
+ if (sessionStorage.getItem("sg_token")) {
|
|
|
+ location.replace('/')
|
|
|
+ } else {
|
|
|
+ next()
|
|
|
+ }
|
|
|
} else {
|
|
|
if (sessionStorage.getItem("sg_token")) {
|
|
|
getInit(to, next)
|