|
|
@@ -26,14 +26,7 @@ const router = new Router({
|
|
|
},
|
|
|
component: () => import('@/pages/cityDangerReport/indexBefore.vue')
|
|
|
},
|
|
|
- {
|
|
|
- path: '/login',
|
|
|
- name: 'login',
|
|
|
- meta: {
|
|
|
- title: '登录'
|
|
|
- },
|
|
|
- component: () => import('@/pages/login/login.vue')
|
|
|
- },
|
|
|
+
|
|
|
{
|
|
|
path: '/citySafeNoticDetail',
|
|
|
name: 'citySafeNoticDetail',
|
|
|
@@ -520,49 +513,49 @@ const router = new Router({
|
|
|
// 路由守卫 拦截
|
|
|
const whiteList = ['citySafeNoticDetail','citySafeNoticBefore','cityDangerReportBefore','vistiorRegistration', 'login', 'register', 'QRcode', 'todo', 'webView', 'registerbycpyinfo', 'cityDangerReport', `addcityDangerReport`,'citySafeNotic'] // 路由守卫白名单
|
|
|
|
|
|
-router.beforeEach((to, from, next) => {
|
|
|
- /* 路由发生变化修改页面title */
|
|
|
- if (to.meta.title) {
|
|
|
- document.title = to.meta.title
|
|
|
- }
|
|
|
- if (whiteList.includes(to.name)) {
|
|
|
- // 在免登录白名单,直接进入
|
|
|
- next()
|
|
|
- } else if (to.path == '/home/home') {
|
|
|
- const uid = auth.uid()
|
|
|
- if (uid) {
|
|
|
- next()
|
|
|
- } else {
|
|
|
- next({
|
|
|
- path: '/cityDangerReportBefore',
|
|
|
- query: to.query
|
|
|
- })
|
|
|
- }
|
|
|
- } else if (to.path !== '/login') {
|
|
|
- const uid = auth.uid()
|
|
|
- if (auth.getUserType() === auth.TYPE_FRAME) {
|
|
|
- if (uid) {
|
|
|
- if (to.path === '/') {
|
|
|
- next({
|
|
|
- path: '/home/home'
|
|
|
- })
|
|
|
- }
|
|
|
- next()
|
|
|
- } else if (to.path === '/register') {
|
|
|
- next()
|
|
|
- } else {
|
|
|
- next({
|
|
|
- path: '/login'
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- next({
|
|
|
- path: '/login'
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- next()
|
|
|
- }
|
|
|
-})
|
|
|
+// router.beforeEach((to, from, next) => {
|
|
|
+// /* 路由发生变化修改页面title */
|
|
|
+// if (to.meta.title) {
|
|
|
+// document.title = to.meta.title
|
|
|
+// }
|
|
|
+// if (whiteList.includes(to.name)) {
|
|
|
+// // 在免登录白名单,直接进入
|
|
|
+// next()
|
|
|
+// } else if (to.path == '/home/home') {
|
|
|
+// const uid = auth.uid()
|
|
|
+// if (uid) {
|
|
|
+// next()
|
|
|
+// } else {
|
|
|
+// next({
|
|
|
+// path: '/cityDangerReportBefore',
|
|
|
+// query: to.query
|
|
|
+// })
|
|
|
+// }
|
|
|
+// } else if (to.path !== '/citySafeNoticDetail') {
|
|
|
+// const uid = auth.uid()
|
|
|
+// if (auth.getUserType() === auth.TYPE_FRAME) {
|
|
|
+// if (uid) {
|
|
|
+// if (to.path === '/') {
|
|
|
+// next({
|
|
|
+// path: '/home/home'
|
|
|
+// })
|
|
|
+// }
|
|
|
+// next()
|
|
|
+// } else if (to.path === '/register') {
|
|
|
+// next()
|
|
|
+// } else {
|
|
|
+// next({
|
|
|
+// path: '/citySafeNoticDetail'
|
|
|
+// })
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// next({
|
|
|
+// path: '/citySafeNoticDetail'
|
|
|
+// })
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// next()
|
|
|
+// }
|
|
|
+// })
|
|
|
|
|
|
export default router
|