v1.0.7 优化权限的单词命名,以及中文命名

This commit is contained in:
zhuoda
2020-02-05 10:51:31 +08:00
parent f9a4917086
commit 07f4bbf291
28 changed files with 311 additions and 131 deletions

View File

@@ -51,7 +51,6 @@ Router.prototype.closeCurrentPageAndPush = function (pushParam) {
};
let storeSelf = store;
router.beforeEach((to, from, next) => {
console.log(to);
iView.LoadingBar.start();
const token = cookie.getToken();
if (!token && to.name !== LOGIN_PAGE_NAME) {
@@ -73,7 +72,13 @@ router.beforeEach((to, from, next) => {
window.scrollTo(0, 0);
} else {
// 特殊页面直接放行
if (to.meta.access) {
if (to.meta.noValidatePrivilege) {
next();
return;
}
//如果是超管,直接放行
if (store.state.user.userLoginInfo.isSuperMan) {
next();
return;
}

View File

@@ -16,7 +16,7 @@ export const emailSetting = [
name: 'EmailList',
meta: {
title: '邮件管理',
childrenPoints: [
privilege: [
{ title: '查询', name: 'email-query' },
{ title: '新增', name: 'email-add' },
{ title: '编辑', name: 'email-update' },
@@ -31,7 +31,7 @@ export const emailSetting = [
name: 'SendMail',
meta: {
title: '发送邮件',
childrenPoints: [{ title: '发送', name: 'email-send' }]
privilege: [{ title: '发送', name: 'email-send' }]
},
component: () => import('@/views/email/send-mail.vue')
}

View File

@@ -16,7 +16,7 @@ export const employee = [
name: 'RoleManage',
meta: {
title: '角色管理',
childrenPoints: [
privilege: [
{
title: '添加角色',
name: 'add-role'
@@ -67,7 +67,7 @@ export const employee = [
name: 'PositionList',
meta: {
title: '岗位管理',
childrenPoints: [
privilege: [
{
title: '查询',
name: 'search-position'
@@ -94,7 +94,7 @@ export const employee = [
name: 'RoleEmployeeManage',
meta: {
title: '员工管理',
childrenPoints: [
privilege: [
{
title: '添加部门',
name: 'add-department'

View File

@@ -5,7 +5,7 @@ export const error = [
name: 'Error401',
meta: {
hideInMenu: true,
access: true
noValidatePrivilege: true
},
component: () => import('@/views/error-page/401.vue')
},
@@ -14,7 +14,7 @@ export const error = [
name: 'Error500',
meta: {
hideInMenu: true,
access: true
noValidatePrivilege: true
},
component: () => import('@/views/error-page/500.vue')
},
@@ -23,7 +23,7 @@ export const error = [
name: 'http://localhost:8080/#employee/role-employee-manage',
meta: {
hideInMenu: true,
access: true
noValidatePrivilege: true
},
component: () => import('@/views/error-page/404.vue')
}

View File

@@ -16,7 +16,7 @@ export const file = [
meta: {
title: '文件列表',
icon: 'ios-cloud-upload',
childrenPoints: [
privilege: [
{ title: '查询', name: 'file-filePage-query' },
{ title: '上传', name: 'file-filePage-upload' },
{ title: '下载', name: 'file-filePage-download' }

View File

@@ -17,7 +17,7 @@ export const heartBeat = [
meta: {
title: '心跳服务',
icon: 'icon iconfont icondingshirenwu',
childrenPoints: [
privilege: [
{
title: '查询任务',
name: 'heart-beat-query'

View File

@@ -7,9 +7,10 @@ export const home = [
redirect: '/home',
component: Main,
meta: {
title: '首页',
noKeepAlive: true,
hideInMenu: true,
access: true,
noValidatePrivilege: true,
icon: 'icon iconfont iconxitongshezhi'
},
children: [
@@ -18,7 +19,7 @@ export const home = [
name: 'Home',
meta: {
title: '首页',
access: true,
noValidatePrivilege: true,
noKeepAlive: true
},
component: () => import('@/views/home')

View File

@@ -10,12 +10,13 @@ export const monitor = [
icon: 'icon iconfont iconxitongjiankong'
},
children: [
// 在线人数
{
path: '/monitor/online-user',
name: 'OnlineUser',
meta: {
title: '在线人数',
childrenPoints: [{ title: '查询', name: 'online-user-search' }]
privilege: [{ title: '查询', name: 'online-user-search' }]
},
component: () => import('@/views/monitor/online-user.vue')
},

View File

@@ -15,7 +15,7 @@ export const notice = [
name: 'NoticeList',
meta: {
title: '通知管理',
childrenPoints: [
privilege: [
{ title: '查询', name: 'notice-query' },
{ title: '添加', name: 'notice-add' },
{ title: '修改', name: 'notice-edit' },
@@ -31,12 +31,21 @@ export const notice = [
name: 'PersonNotice',
meta: {
title: '个人消息',
childrenPoints: [
privilege: [
{ title: '查询', name: 'person-notice-query' },
{ title: '详情', name: 'person-notice-detail' }
]
},
component: () => import('@/views/notice/person-notice.vue')
},
{
path: '/notice/notice-detail',
name: 'NoticeDetail',
meta: {
title: '消息详情',
hideInMenu:true
},
component: () => import('@/views/notice/notice-detail.vue')
}
]
}

View File

@@ -17,7 +17,7 @@ export const reload = [
meta: {
title: 'SmartReload',
icon: 'icon iconfont icondongtaijiazai',
childrenPoints: [
privilege: [
{
title: '查询',
name: 'smart-reload-search'

View File

@@ -16,7 +16,7 @@ export const systemSetting = [
name: 'SystemConfig',
meta: {
title: '系统参数',
childrenPoints: [
privilege: [
{
title: '查询系统参数',
name: 'system-params-search'
@@ -42,8 +42,8 @@ export const systemSetting = [
path: '/system-setting/system-privilege',
name: 'SystemPrivilege',
meta: {
title: '菜单管理',
childrenPoints: [
title: '菜单权限',
privilege: [
{
title: '编辑',
name: 'privilege-main-update'

View File

@@ -17,7 +17,7 @@ export const task = [
meta: {
title: '任务管理',
icon: 'icon iconfont icondingshirenwu',
childrenPoints: [
privilege: [
{
title: '查询任务',
name: 'task-search'

View File

@@ -24,7 +24,7 @@ export const threeRouter = [
name: 'RoleOneTwo',
meta: {
title: '三级A',
childrenPoints: [
privilege: [
{ title: '添加', name: 'roleOneTwo-add' },
{ title: '删除', name: 'roleOneTwo-delete' }
]
@@ -36,7 +36,7 @@ export const threeRouter = [
name: 'RoleTwoTwo',
meta: {
title: '三级B',
childrenPoints: [
privilege: [
{ title: '添加', name: 'roleTwoTwo-add' },
{ title: '删除', name: 'roleTwoTwo-delete' }
]
@@ -50,7 +50,7 @@ export const threeRouter = [
name: 'RoleOneOne',
meta: {
title: '二级菜单',
childrenPoints: [
privilege: [
{ title: '添加', name: 'roleOneOne-add' },
{ title: '删除', name: 'roleOneOne-delete' }
]

View File

@@ -16,7 +16,7 @@ export const userLog = [
name: 'UserOperateLog',
meta: {
title: '用户操作日志',
childrenPoints: [
privilege: [
{ title: '查询', name: 'user-operate-log-search' },
{ title: '详情', name: 'user-operate-log-detail' },
{ title: '删除', name: 'user-operate-log-delete' }
@@ -30,7 +30,7 @@ export const userLog = [
name: 'UserLoginLog',
meta: {
title: '用户登录日志',
childrenPoints: [
privilege: [
{ title: '查询', name: 'user-login-log-search' },
{ title: '删除', name: 'user-login-log-delete' }
]

View File

@@ -24,9 +24,9 @@ import { file } from './module/file';
* 可以传入一个回调函数,参数是当前路由对象,例子看动态路由和带参路由
* hideInBread: (false) 设为true后此级路由将不会出现在面包屑中示例看QQ群路由配置
* hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项,
* group:{String} 同一功能模块下子页面的功能点权限继承菜单模块创建的路由权限 by lihaifan&lipeng
* privilegeExtend:{String} 同一功能模块下子页面的功能点权限继承菜单模块创建的路由权限 by lihaifan&lipeng
* noKeepAlive: (false) 设为true后页面在切换标签后不会缓存如果需要缓存无需设置这个字段而且需要设置页面组件name属性和路由配置的name一致
* access: (null) 可访问该页面的权限数组,当前路由设置的权限会影响子路由
* noValidatePrivilege: (true) 表示此路由不需要验证权限
* }
*/
// 登录模块
@@ -35,7 +35,8 @@ export const login = {
name: 'login',
meta: {
hideInMenu: true,
title: 'Login - 登录'
title: 'Login - 登录',
noValidatePrivilege:true
},
component: () => import('@/views/login/login.vue')
};