frontend: Fix router guard

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao
2020-03-15 19:20:20 +08:00
parent 2646d5579d
commit 0d36eee7d3
2 changed files with 1 additions and 11 deletions
-10
View File
@@ -31,16 +31,6 @@ const router = new VueRouter({
});
router.beforeEach((to, from, next) => {
if (to.path === '/rtty' && to.query.devid) {
next();
return;
}
if (to.path === '/' && to.query.id) {
router.push({path: '/rtty', query: {devid: to.query.id, username: to.query.username, password: to.query.password}});
return;
}
if (to.path !== '/login' && !sessionStorage.getItem('rtty-sid')) {
router.push('/login');
return;
+1 -1
View File
File diff suppressed because one or more lines are too long