跳转后台管理

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 = () => { const onJumpUser = () => {
// router.push({ name: 'my-user' }) router.push({ name: 'my-user' })
const isType: any = localStorage.getItem('rolesType') // const isType: any = localStorage.getItem('rolesType')
if (isType == 3) { // if (isType == 3) {
const host = window.location.origin // const host = window.location.origin
if (host.indexOf('sgwpdm.ah.sgcc.com.cn') > -1) { // if (host.indexOf('sgwpdm.ah.sgcc.com.cn') > -1) {
window.open(`${host}/iws/glweb/login?token@${store.token}@`) // window.open(`${host}/iws/glweb/login?token@${store.token}@`)
} else { // } else {
// window.open(`${host}/glweb/?token@${store.token}@`) // // window.open(`${host}/glweb/?token@${store.token}@`)
if (import.meta.env.VITE_ENV === 'production') { // if (import.meta.env.VITE_ENV === 'production') {
window.open(`${host}/glweb/?token@${store.token}@`) // window.open(`${host}/glweb/?token@${store.token}@`)
} else { // } else {
window.open(`${host}/iws/glweb/?token@${store.token}@`) // window.open(`${host}/iws/glweb/?token@${store.token}@`)
} // }
} // }
} else { // } else {
router.push({ name: 'my-user' }) // router.push({ name: 'my-user' })
} // }
} }
const onClickLogin = () => { const onClickLogin = () => {

View File

@ -7,26 +7,28 @@ import { useRoute } from 'vue-router'
const store: any = useStore() const store: any = useStore()
const router = useRouter() const router = useRouter()
const route = useRoute() 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 imgSrc from '@/assets/img/logo.png'
import { el } from 'element-plus/es/locale' import { el } from 'element-plus/es/locale'
const handleSelect = (name: any, path: any) => { const handleSelect = (name: any, path: any) => {
console.log('🚀 ~ handleSelect ~ name:', name) console.log('🚀 ~ handleSelect ~ name:', name)
console.log('🚀 ~ handleSelect ~ store.token:', store.token)
if (name == 'admin') { 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) { if (host.indexOf('sgwpdm.ah.sgcc.com.cn') > -1) {
// window.open(`${host}/iws/glweb/login?token@${store.token}@`) window.open(`${host}/iws/glweb/login?token=${token}`)
// } else { } else {
// // window.open(`${host}/glweb/?token@${store.token}@`) if (import.meta.env.VITE_ENV === 'production') {
// if (import.meta.env.VITE_ENV === 'production') { window.open(`${host}/glweb/?token=${token}`)
// window.open(`${host}/glweb/?token@${store.token}@`) } else {
// } else { window.open(`${host}/iws/glweb/?token=${token}`)
// window.open(`${host}/iws/glweb/?token@${store.token}@`) // window.open(`${'http://localhost:1024'}/iws/glweb/?token=${token}`)
// } }
// } }
} else { } else {
store.editcurrentMenuItem(name) store.editcurrentMenuItem(name)
router.push({ router.push({
@ -53,14 +55,14 @@ const lessorMenus: MenuItem[] = [
{ title: '接单管理', name: 'accept-orders', permission: ['1'] }, { title: '接单管理', name: 'accept-orders', permission: ['1'] },
{ title: '质检管理', name: 'quality-manage', permission: ['1'] }, { title: '质检管理', name: 'quality-manage', permission: ['1'] },
{ title: '合同管理', name: 'contract-manage', permission: ['1'] }, { title: '合同管理', name: 'contract-manage', permission: ['1'] },
// { title: '', name: 'admin', permission: ['1'] }, { title: '后台管理', name: 'admin', permission: ['1'] },
] ]
// --- // ---
const lesseeMenus: MenuItem[] = [ const lesseeMenus: MenuItem[] = [
{ title: '需求管理', name: 'sourcingNeed', permission: ['2'] }, { title: '需求管理', name: 'sourcingNeed', permission: ['2'] },
{ title: '租赁订单', name: 'orderManagement', permission: ['2'] }, { title: '租赁订单', name: 'orderManagement', permission: ['2'] },
{ title: '收货地址管理', name: 'address-manage', 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(() => { const menuList: any = computed(() => {
return rolesType.value == '承租方' return rolesType.value == '承租方'
? allList.filter((e) => e.permission.includes('2')) ? allList.filter((e) => {
: allList.filter((e) => e.permission.includes('1')) 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(() => { const activeItem = computed(() => {