|
@@ -261,12 +261,18 @@ const routes = [
|
|
|
import(
|
|
|
/* webpackChunkName: "download" */ "../features/download/Download.vue"
|
|
|
),
|
|
|
+ meta: {
|
|
|
+ noAuth: true,
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
path: "/login",
|
|
|
name: "Login",
|
|
|
component: () =>
|
|
|
import(/* webpackChunkName: "Login" */ "../features/Login/Login.vue"),
|
|
|
+ meta: {
|
|
|
+ noAuth: true,
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
path: "*",
|
|
@@ -289,8 +295,12 @@ router.beforeEach((to, from, next) => {
|
|
|
if (to.path) {
|
|
|
window._hmt.push(["_trackPageview", to.fullPath]);
|
|
|
}
|
|
|
+ if (to.meta.noAuth) {
|
|
|
+ next();
|
|
|
+ return;
|
|
|
+ }
|
|
|
const token = getToken();
|
|
|
- if (isNil(token) && to.path.includes("/login") === false) {
|
|
|
+ if (isNil(token)) {
|
|
|
router.push("/login?redirectTo=" + encodeURI(to.fullPath));
|
|
|
next(false);
|
|
|
} else {
|