You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.3 KiB
56 lines
2.3 KiB
const Layout = () => import('@/layout')
|
|
/* 权限路由 */
|
|
//const orgRegCheck = () => import('@/views/system-admin/check/company.vue') // 单位注册审核
|
|
//const personRegCheck = () => import('@/views/system-admin/check/people.vue') // 个人注册审核
|
|
//const personJoinCheck = () => import('@/views/system-admin/check/personnel.vue') // 人员绑定审核
|
|
//const deptManage = () => import('@/views/system-admin/orgsetup/index.vue') // 内部机构设置
|
|
const region = () => import('@/views/region/region.vue') // 区域管理
|
|
const userManage = () => import('@/views/userManage/userManage.vue') // 用户管理
|
|
const roleManage = () => import('@/views/system-admin/role.vue') // 角色管理
|
|
const sourceManage = () => import('@/views/sourceManage/sourceManage.vue') // 资源管理
|
|
|
|
const menuManage = () => import('@/views/menuManage/menuManage.vue') // 菜单管理
|
|
|
|
const dictManage = () => import('@/views/dictManage/dictManage.vue') // 数据字典
|
|
const logManage = () => import('@/views/logManage/logManage.vue') // 日志管理
|
|
const PwdModify = () => import('@/views/PwdModify/PwdModify.vue') // 修改密码
|
|
|
|
const UserAdminister = () => import('@/views/system-admin/UserAdminister/index.vue') // 单位用户管理
|
|
const RoleAdminister = () => import('@/views/RoleAdminister/RoleAdminister.vue') // 业务角色管理
|
|
|
|
/* 获取权限路由列表 */
|
|
import {getrolemenus} from '@/api/system/Role/role.js'
|
|
import {getSession} from '@/utils/auth.js'
|
|
|
|
export async function getRoleRouter(userSid) {
|
|
let rolemenus = await getrolemenus({userSid: userSid})
|
|
let userRoles = resRouter(rolemenus.data)
|
|
userRoles.push({path: '*', redirect: '/404', hidden: true})
|
|
return userRoles
|
|
}
|
|
|
|
|
|
function resRouter(menus) { //递归,将后台传来数组
|
|
for (var i = 0; i < menus.length; i++) {
|
|
if (menus[i].children && menus[i].children.length != 0) {
|
|
resRouter(menus[i].children)
|
|
}
|
|
console.log(menus[i].component)
|
|
if (menus[i].children.length == 0) {
|
|
delete menus[i].children
|
|
delete menus[i].redirect
|
|
}
|
|
if (menus[i].component != '') {
|
|
menus[i].component = eval(menus[i].path.substr(1))
|
|
console.log(menus[i])
|
|
menus[i] = {
|
|
path: menus[i].path,
|
|
component: Layout,
|
|
redirect: menus[i].path,
|
|
children: [menus[i]]
|
|
}
|
|
}
|
|
}
|
|
console.log(menus)
|
|
return menus
|
|
}
|
|
|