|
|
@@ -1,6 +1,7 @@
|
|
|
import Vue from "vue";
|
|
|
import Router from "vue-router";
|
|
|
import store from "../store/index";
|
|
|
+import vm from "@/main.js";
|
|
|
|
|
|
Vue.use(Router);
|
|
|
|
|
|
@@ -115,7 +116,7 @@ const router = new Router({
|
|
|
path: "/overtimeApplication",
|
|
|
component: () => import("@/views/overtime/overtimeApplication"),
|
|
|
meta: {
|
|
|
- title: "加班管理",
|
|
|
+ title: "加班申请",
|
|
|
keepAlive: false
|
|
|
}
|
|
|
},
|
|
|
@@ -222,6 +223,15 @@ router.beforeEach((to, from, next) => {
|
|
|
let { isLogin } = store.state;
|
|
|
document.title = title;
|
|
|
|
|
|
+ console.log("from:", from.path, " to:", to.path);
|
|
|
+
|
|
|
+ if (to.path === "/login" && from.path === "/my/center") {
|
|
|
+ if (vm && vm.$root) {
|
|
|
+ // keep-alive使用include控制缓存,清空Index的缓存
|
|
|
+ vm.$root.$emit('clearIndexCache')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (needLogin && !isLogin) {
|
|
|
next({
|
|
|
path: "/login"
|