路由配置


文件: src/router/data.js 中配置路由和权限信息

path路由的path,
name路由名称
type
页面类型
normal:登录用户,带用户菜单的页面
empty:空模板,一个全屏的空白内容
empty-user:一个空白页面,会校验用户是否登录
title标题,会更改page.title
noAuthorize框架在路由跳转的时候会做权限校验,如果没有权限不允许打开路由,如果要取消路由权限检查,需要把noAuthorize设置为true
defaultURLs包含的后台API接口,如果需要权限才能调用的,应该放入对应权限设置的对象中
authorize权限列表
authorize.name权限名称
authorize.description
权限描述
authorize.value
权限值
authorize.urls
权限对用的后台API接口
component
路由中的components
const routes = [
  {
    path: '/position',
    name: 'position',
    type: 'normal',
    title: '岗位管理',
    defaultURLs: [],
    authorize: [],
    component: () =>
      import(/* webpackChunkName: "position" */ '../views/position/index.vue'),
  },
  {
    path: '/user',
    name: 'user',
    type: 'normal',
    title: '用户管理',
    defaultURLs: ['/api/microapps/user/search', '/api/microapps/user/get'],
    authorize: [
      {
        name: 'add',
        description: '新增',
        value: 1,
        urls: ['/api/microapps/user/create'],
      },
      {
        name: 'update',
        description: '编辑',
        value: 2,
        urls: ['/api/microapps/user/update'],
      },
      {
        name: 'delete',
        description: '删除',
        value: 4,
        urls: ['/api/microapps/user/delete'],
      },
      {
        name: 'resetpwd',
        description: '重置密码',
        value: 8,
        urls: ['/api/microapps/user/resetPwd'],
      },
      {
        name: 'setAuthorize',
        description: '权限设置',
        value: 16,
        urls: ['/api/microapps/ClientCode/GetDropDownDataSource','/api/microapps/Authorize/treemenus','/api/microapps/authorize/update'],
      },
    ],
    component: () =>
      import(/* webpackChunkName: "user" */ '../views/user/index.vue'),
  },
]

module.exports = routes

 

版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
YES开发框架
上一篇:权限配置
评论列表

发表评论

评论内容
昵称:
关联文章