路由配置
文件: 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开发框架网发布内容,转载请附上原文出处连接
YESWEB YES开发框架