跳转后台管理
This commit is contained in:
parent
f5c4e82a1d
commit
e5ceffae1b
|
|
@ -289,24 +289,24 @@ const nickNameNew = computed(() => {
|
|||
})
|
||||
|
||||
const onJumpUser = () => {
|
||||
// router.push({ name: 'my-user' })
|
||||
const isType: any = localStorage.getItem('rolesType')
|
||||
if (isType == 3) {
|
||||
const host = window.location.origin
|
||||
router.push({ name: 'my-user' })
|
||||
// const isType: any = localStorage.getItem('rolesType')
|
||||
// if (isType == 3) {
|
||||
// const host = window.location.origin
|
||||
|
||||
if (host.indexOf('sgwpdm.ah.sgcc.com.cn') > -1) {
|
||||
window.open(`${host}/iws/glweb/login?token@${store.token}@`)
|
||||
} else {
|
||||
// window.open(`${host}/glweb/?token@${store.token}@`)
|
||||
if (import.meta.env.VITE_ENV === 'production') {
|
||||
window.open(`${host}/glweb/?token@${store.token}@`)
|
||||
} else {
|
||||
window.open(`${host}/iws/glweb/?token@${store.token}@`)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
router.push({ name: 'my-user' })
|
||||
}
|
||||
// if (host.indexOf('sgwpdm.ah.sgcc.com.cn') > -1) {
|
||||
// window.open(`${host}/iws/glweb/login?token@${store.token}@`)
|
||||
// } else {
|
||||
// // window.open(`${host}/glweb/?token@${store.token}@`)
|
||||
// if (import.meta.env.VITE_ENV === 'production') {
|
||||
// window.open(`${host}/glweb/?token@${store.token}@`)
|
||||
// } else {
|
||||
// window.open(`${host}/iws/glweb/?token@${store.token}@`)
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// router.push({ name: 'my-user' })
|
||||
// }
|
||||
}
|
||||
|
||||
const onClickLogin = () => {
|
||||
|
|
|
|||
|
|
@ -7,26 +7,28 @@ import { useRoute } from 'vue-router'
|
|||
const store: any = useStore()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const isAdmin = ref(JSON.parse(localStorage.getItem('main')).userInfo.admin)
|
||||
console.log('🚀 ~ isAdmin:', isAdmin)
|
||||
|
||||
import imgSrc from '@/assets/img/logo.png'
|
||||
import { el } from 'element-plus/es/locale'
|
||||
|
||||
const handleSelect = (name: any, path: any) => {
|
||||
console.log('🚀 ~ handleSelect ~ name:', name)
|
||||
console.log('🚀 ~ handleSelect ~ store.token:', store.token)
|
||||
if (name == 'admin') {
|
||||
// const host = window.location.origin
|
||||
const token = localStorage.getItem('tokenNew')
|
||||
const host = window.location.origin
|
||||
|
||||
// if (host.indexOf('sgwpdm.ah.sgcc.com.cn') > -1) {
|
||||
// window.open(`${host}/iws/glweb/login?token@${store.token}@`)
|
||||
// } else {
|
||||
// // window.open(`${host}/glweb/?token@${store.token}@`)
|
||||
// if (import.meta.env.VITE_ENV === 'production') {
|
||||
// window.open(`${host}/glweb/?token@${store.token}@`)
|
||||
// } else {
|
||||
// window.open(`${host}/iws/glweb/?token@${store.token}@`)
|
||||
// }
|
||||
// }
|
||||
if (host.indexOf('sgwpdm.ah.sgcc.com.cn') > -1) {
|
||||
window.open(`${host}/iws/glweb/login?token=${token}`)
|
||||
} else {
|
||||
if (import.meta.env.VITE_ENV === 'production') {
|
||||
window.open(`${host}/glweb/?token=${token}`)
|
||||
} else {
|
||||
window.open(`${host}/iws/glweb/?token=${token}`)
|
||||
// window.open(`${'http://localhost:1024'}/iws/glweb/?token=${token}`)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
store.editcurrentMenuItem(name)
|
||||
router.push({
|
||||
|
|
@ -53,14 +55,14 @@ const lessorMenus: MenuItem[] = [
|
|||
{ title: '接单管理', name: 'accept-orders', permission: ['1'] },
|
||||
{ title: '质检管理', name: 'quality-manage', permission: ['1'] },
|
||||
{ title: '合同管理', name: 'contract-manage', permission: ['1'] },
|
||||
// { title: '后台管理', name: 'admin', permission: ['1'] },
|
||||
{ title: '后台管理', name: 'admin', permission: ['1'] },
|
||||
]
|
||||
// 按角色分组定义菜单---承租方
|
||||
const lesseeMenus: MenuItem[] = [
|
||||
{ title: '需求管理', name: 'sourcingNeed', permission: ['2'] },
|
||||
{ title: '租赁订单', name: 'orderManagement', permission: ['2'] },
|
||||
{ title: '收货地址管理', name: 'address-manage', permission: ['2'] },
|
||||
// { title: '后台管理', name: 'admin', permission: ['2'] },
|
||||
{ title: '后台管理', name: 'admin', permission: ['2'] },
|
||||
]
|
||||
|
||||
// 合并所有菜单项
|
||||
|
|
@ -73,8 +75,20 @@ if (localStorage.getItem('rolesTypeName')) {
|
|||
}
|
||||
const menuList: any = computed(() => {
|
||||
return rolesType.value == '承租方'
|
||||
? allList.filter((e) => e.permission.includes('2'))
|
||||
: allList.filter((e) => e.permission.includes('1'))
|
||||
? allList.filter((e) => {
|
||||
if (isAdmin.value) {
|
||||
return e.permission.includes('2')
|
||||
} else {
|
||||
return e.permission.includes('2') && e.name != 'admin'
|
||||
}
|
||||
})
|
||||
: allList.filter((e) => {
|
||||
if (isAdmin.value) {
|
||||
return e.permission.includes('1')
|
||||
} else {
|
||||
return e.permission.includes('1') && e.name != 'admin'
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
const activeItem = computed(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue