|
@@ -1,9 +1,14 @@
|
|
|
import router from "./router";
|
|
|
-import { getCookie,removeToken } from "@/utills/auth"; // getToken from cookie
|
|
|
+import { getCookie, removeToken } from "@/utills/auth"; // getToken from cookie
|
|
|
import { Base64 } from "js-base64";
|
|
|
const whiteList = ["/integratedAlarm", "/login", "/logout"]; // 不重定向白名单
|
|
|
import store from "@/store";
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
+ if (to.path == "/login" || to.path == "/") {
|
|
|
+ next({ path: "/integratedAlarm" });
|
|
|
+ } else {
|
|
|
+ next();
|
|
|
+ }
|
|
|
// if (getCookie("authToken")) {
|
|
|
// if (to.path == "/login" || to.path == "/") {
|
|
|
// next({ path: "/integratedAlarm" });
|
|
@@ -15,7 +20,6 @@ router.beforeEach((to, from, next) => {
|
|
|
// } else {
|
|
|
// next(`/login?redirect=${to.fullPath}`);
|
|
|
// }
|
|
|
- next();
|
|
|
});
|
|
|
|
|
|
-router.afterEach((to, from, next) => {});
|
|
|
+router.afterEach((to, from, next) => { });
|