跳转后台管理

This commit is contained in:
bb_pan 2025-02-26 17:09:25 +08:00
parent f5c4e82a1d
commit e5ceffae1b
2 changed files with 47 additions and 33 deletions

View File

@ -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
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 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' })
// }
}
const onClickLogin = () => {

View File

@ -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(() => {