xieb
2025-03-06 8b23471d428d7d0a6444726cb5c1603a8b3d4010
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
 * @Author: Morpheus
 * @Date: 2021-04-30 14:12:09
 * @Last Modified by: Morpheus
 * @Last Modified time: 2022-07-29 09:15:23
 */
 
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
 
const routes = [
  {
    path: "/",
    component: () => import("../../views/layout/index.vue"),
    meta: {
      keepAlive: true, // 启用缓存路由
    },
  },
  //身份判别
  {
    path: "/discrimination",
    component: () => import("../../views/discrimination/index.vue"),
    meta: { title: '中图铜镜' }
  },
  //登录页面
  {
    path: "/login",
    component: () => import("../../views/login/index.vue"),
    meta: { title: '登录' }
  },
  //留言
  {
    path: "/message",
    component: () => import("../../views/message/index.vue"),
    meta: { title: '铜为镜,正衣冠' }
  },
  //添加留言
  {
    path: "/Addmessage",
    component: () => import("../../views/Addmessage/index.vue"),
    meta: { title: '中图铜镜' }
  },
  //评分
  {
    path: "/examine",
    name: "/examine",
    component: () => import("../../views/examine/index.vue"),
    meta: { title: '要公正,重考核' }
  },
  //去评分
  {
    path: "/toexamine",
    component: () => import("../../views/toexamine/index.vue"),
    meta: { title: '中图铜镜' }
 
  },
  // 评优页面
  {
    path: "/Appraising",
    component: () => import("../../views/Appraising/index.vue"),
    meta: { title: '求卓越,争创优', allowBack: false }
  },
  // 去评优
  {
    path: "/toAppraising",
    component: () => import("../../views/toAppraising/index.vue"),
    meta: { title: '中图铜镜' }
  },
  //员工评优
  {
    path: '/toAppraisingfirst',
    component: () => import("../../views/toAppraising/toAppraisingfirst.vue"),
    meta: { title: '中图铜镜' }
  },
  //第一次评优,部门级评优
  {
    path: '/toAppraisingone',
    component: () => import("../../views/toAppraising/toAppraisingone.vue"),
    meta: { title: '中图铜镜' }
  },
  //部门评优
  {
    path: '/toAppraisingtwo',
    component: () => import("../../views/toAppraising/toAppraisingtwo.vue"),
    meta: { title: '中图铜镜' }
  },
  {
    path: '/toAppraisingthree',
    component: () => import("../../views/toAppraising/toAppraisingthree.vue"),
    meta: { title: '中图铜镜' }
  },
 
];
 
 
const router = new VueRouter({
  base: process.env.BASE_URL,
  routes,
  mode: 'history',
});
 
router.beforeEach((to, from, next) => {
  // 判断当前跳转到的页面是否为禁止返回的页面
  if (to.path === '/Appraising' || to.path === '/examine' || to.path === '/message') {
    // 清除浏览器历史记录,防止返回上一个页面
    window.history.pushState(null, null, document.URL);
    window.addEventListener('popstate', function () {
      history.go(1);
    });
  }
 
  next();
});
export default router;