feige
2025-05-06 c4d4c5d25cd78fa302fe07a824c8d7b3412bd9f1
src/router/index.js
@@ -1,11 +1,11 @@
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/**
 * Note: 路由配置项
 *
@@ -27,7 +27,7 @@
    activeMenu: '/system/user'      // 当路由设置了该属性,则会高亮相对应的侧边栏。
  }
 */
// 公共路由
export const constantRoutes = [
  {
@@ -77,7 +77,7 @@
        name: 'Index',
        meta: { title: '首页', icon: 'dashboard', affix: true }
      }
    ]
  },
  {
@@ -95,7 +95,7 @@
    ]
  }
]
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [
  {
@@ -116,13 +116,47 @@
    path: '/family/note1',
    component: Layout,
    permissions: ['family:note:list'],
    hidden: true,
    children: [
      {
        path: 'propertyInfo/:id(\\d+)',
        component: () => import('@/views/note/propertyInfo'),
        name: 'propertyInfo',
        meta: { title: '查询详情'}
      }
    ]
  },
  //个人
  {
    path: '/self/self1',
    component: Layout,
    permissions: ['self:self:list'],
    hidden: true,
    children: [
      {
        path: 'propertyInfo/:id(\\d+)',
        component: () => import('@/views/note/propertyInfo'),
        name: 'propertyInfo',
        meta: { title: '查询详情'}
      }
    ]
  },
//家大事记的详情
  {
    path: '/family1/bignote',
    component: Layout,
    // permissions: [],
       permissions: ['family1:bignote:list'],
    hidden: true,
    children: [
      {
        path: 'familyeventInfo/:id(\\d+)',
        component: () => import('@/views/bignote/familyeventInfo'),
        name: 'familyeventInfo',
        meta: { title: '查询详情'}
      }
    ]
@@ -184,15 +218,15 @@
    ]
  }
]
// 防止连续点击多次路由报错
let routerPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(err => err)
}
export default new Router({
  mode: 'history', // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})
})