权限地址判断
This commit is contained in:
parent
36f4016c05
commit
f81750a949
42
src/main.js
42
src/main.js
@ -46,7 +46,10 @@ new Vue({
|
|||||||
keyWords:null,//关键字
|
keyWords:null,//关键字
|
||||||
description:null,//描述
|
description:null,//描述
|
||||||
sitetitle:null,//标题
|
sitetitle:null,//标题
|
||||||
sitetitleinit:null//
|
sitetitleinit:null,//
|
||||||
|
firstlevelmenu:['/case-management','/mediation-package','/case-package','/payment-receipt','/mediation-management',
|
||||||
|
'/system-management/area-management','/system-management/role-permissions-management',
|
||||||
|
'/system-management/role-management','/system-management/user-management']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
metaInfo () {
|
metaInfo () {
|
||||||
@ -60,7 +63,42 @@ new Vue({
|
|||||||
render: h => h(App),
|
render: h => h(App),
|
||||||
watch:{
|
watch:{
|
||||||
'$route': function(to, from) {
|
'$route': function(to, from) {
|
||||||
console.log(to,from,'路由信息')
|
// console.log(to,from,'路由信息')
|
||||||
|
|
||||||
|
// 判断当前登录人是否有该地址的访问权限
|
||||||
|
if(this.firstlevelmenu.includes(to.path))
|
||||||
|
{
|
||||||
|
let interviewFlag = false
|
||||||
|
if(JSON.parse(sessionStorage.getItem('userInfo')))
|
||||||
|
{
|
||||||
|
let resources = JSON.parse(sessionStorage.getItem('userInfo')).resources
|
||||||
|
let menuTree = resources[0].children
|
||||||
|
|
||||||
|
menuTree.forEach(item =>{
|
||||||
|
if(item.url == to.path){ interviewFlag = true}
|
||||||
|
if(!interviewFlag)
|
||||||
|
{
|
||||||
|
item.children.forEach(item =>{
|
||||||
|
if(item.url == to.path){ interviewFlag = true}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(!interviewFlag)
|
||||||
|
{
|
||||||
|
// 判断当前登录人角色,如果是普通调解员,则默认展示区域且不可选择
|
||||||
|
let identifier = this.$store.state.userinfo.roleIdentifier
|
||||||
|
if(identifier.includes('manager'))
|
||||||
|
{
|
||||||
|
router.push('/workbench')
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
router.push('/workbenchcm')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(to.meta.title!=null&&to.meta.sitetitleinit!=null)
|
if(to.meta.title!=null&&to.meta.sitetitleinit!=null)
|
||||||
{
|
{
|
||||||
this.sitetitle=to.meta.title+'-'+this.sitetitleinit;
|
this.sitetitle=to.meta.title+'-'+this.sitetitleinit;
|
||||||
|
|||||||
@ -252,7 +252,7 @@
|
|||||||
if(JSON.parse(sessionStorage.getItem('userInfo'))){
|
if(JSON.parse(sessionStorage.getItem('userInfo'))){
|
||||||
this.userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
|
this.userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
|
||||||
}
|
}
|
||||||
console.log('获取当前登录人的信息',this.userInfo)
|
// console.log('获取当前登录人的信息',this.userInfo)
|
||||||
// console.log(this.userInfo.showName)
|
// console.log(this.userInfo.showName)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@ -47,16 +47,17 @@
|
|||||||
if(this.menuTree.length>0)
|
if(this.menuTree.length>0)
|
||||||
{
|
{
|
||||||
// 判断当前登录人角色,如果是普通调解员,则默认展示区域且不可选择
|
// 判断当前登录人角色,如果是普通调解员,则默认展示区域且不可选择
|
||||||
let identifier = this.$store.state.userinfo.identifier
|
let identifier = this.$store.state.userinfo.roleIdentifier
|
||||||
if(identifier=='mediator'){
|
if(identifier.includes('manager'))
|
||||||
// 调解员
|
|
||||||
this.menuTree.unshift({children:[],id:0,menuIcon:"menu-home",name:"调解首页",nameEn:"",pid:0,prefix:"mediate",sort:0,type:1,typeName:"",url:"/workbenchcm"})
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// 案件管理员
|
// 案件管理员
|
||||||
this.menuTree.unshift({children:[],id:0,menuIcon:"menu-home",name:"调解首页",nameEn:"",pid:0,prefix:"mediate",sort:0,type:1,typeName:"",url:"/workbench"})
|
this.menuTree.unshift({children:[],id:0,menuIcon:"menu-home",name:"调解首页",nameEn:"",pid:0,prefix:"mediate",sort:0,type:1,typeName:"",url:"/workbench"})
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 调解员
|
||||||
|
this.menuTree.unshift({children:[],id:0,menuIcon:"menu-home",name:"调解首页",nameEn:"",pid:0,prefix:"mediate",sort:0,type:1,typeName:"",url:"/workbenchcm"})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -181,7 +181,13 @@ export default {
|
|||||||
let socketUrl = res.brokerEndpoint ? res.brokerEndpoint : `wss://mediate.dev.trydotec.com/mediate/ws/websocket`;
|
let socketUrl = res.brokerEndpoint ? res.brokerEndpoint : `wss://mediate.dev.trydotec.com/mediate/ws/websocket`;
|
||||||
this.$stompSocket.initStomp(socketUrl,a => this.socketSucc(a), b => this.socketErr(b));
|
this.$stompSocket.initStomp(socketUrl,a => this.socketSucc(a), b => this.socketErr(b));
|
||||||
if (res.user.resources.length > 0) {
|
if (res.user.resources.length > 0) {
|
||||||
let url = "/workbench";
|
|
||||||
|
let url = "/workbenchcm";
|
||||||
|
let identifier = res.user.roleIdentifier
|
||||||
|
if(identifier.includes('manager'))
|
||||||
|
{
|
||||||
|
url = '/workbench'
|
||||||
|
}
|
||||||
// let data= res.user.resources[0].children[0]
|
// let data= res.user.resources[0].children[0]
|
||||||
// if(data.children.length>0){
|
// if(data.children.length>0){
|
||||||
// url = data.children[0].url
|
// url = data.children[0].url
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user