From c2b4076e9e7f501ca17d719ce86a7e5a1c95ecd3 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Mon, 10 Feb 2025 10:41:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Navmenu/index.vue | 6 ++--- src/layout/header.vue | 45 ++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/components/Navmenu/index.vue b/src/components/Navmenu/index.vue index b50f63b..76e71a9 100644 --- a/src/components/Navmenu/index.vue +++ b/src/components/Navmenu/index.vue @@ -26,7 +26,7 @@ const navMenuList = computed(() => { // { name: '订单管理', routerName: 'orderManagementCz' }, // { name: '接单管理', routerName: 'accept-orders' }, { name: '公告', routerName: 'enterpriseZone' }, - // { name: '数据大屏', routerName: 'big-screen' }, + { name: '数据大屏', routerName: 'big-screen' }, ] if (isType == 2) return [ @@ -36,7 +36,7 @@ const navMenuList = computed(() => { { name: '订单管理', routerName: 'orderManagement' }, { name: '需求管理', routerName: 'sourcingNeed' }, { name: '通知公告', routerName: 'enterpriseZone' }, - // { name: '数据大屏', routerName: 'big-screen' }, + { name: '数据大屏', routerName: 'big-screen' }, ] if (isType == 3) @@ -45,7 +45,7 @@ const navMenuList = computed(() => { { name: '装备共享大厅', routerName: 'equipList' }, { name: '租赁需求大厅', routerName: 'parity' }, { name: '通知公告', routerName: 'enterpriseZone' }, - // { name: '数据大屏', routerName: 'big-screen' }, + { name: '数据大屏', routerName: 'big-screen' }, ] }) diff --git a/src/layout/header.vue b/src/layout/header.vue index 34794ad..396e499 100644 --- a/src/layout/header.vue +++ b/src/layout/header.vue @@ -42,19 +42,25 @@ const isShowLogout = computed(() => { return store.token }) -watch(userInfo, (newValue, oldCount) => { - if (newValue.companyId) { - getCompanyListApi().then((res: any) => { - res.data.filter((e: any) => { - if (e.companyId == newValue.companyId) { - activeLoginCompanyName.value = e.companyName - } - }) - }).catch((err: any) => { - console.log('🚀 ~ getCompanyListApi ~ err:', err) - }) - } -}, { immediate: true }) +watch( + userInfo, + (newValue, oldCount) => { + if (newValue.companyId) { + getCompanyListApi() + .then((res: any) => { + res.data.filter((e: any) => { + if (e.companyId == newValue.companyId) { + activeLoginCompanyName.value = e.companyName + } + }) + }) + .catch((err: any) => { + console.log('🚀 ~ getCompanyListApi ~ err:', err) + }) + } + }, + { immediate: true }, +) // watch(token, (newValue, oldCount) => { // if (newValue) { // getUserListData() @@ -311,9 +317,16 @@ const onJumpUser = () => { } const onClickLogin = () => { - window.location.replace( - 'http://sgwpdm.ah.sgcc.com.cn/iws/cas/login?appId=3874dcb953f184dc75450e33d6d6d4fa&service=http://sgwpdm.ah.sgcc.com.cn/iws/mall-view/', - ) + if (import.meta.env.VITE_API_URL == '/proxyApi') { + router.push('/login') // 公司-重定向登录 + } else { + // 宏源-重定向登录 + setTimeout(() => { + window.location.replace( + 'http://sgwpdm.ah.sgcc.com.cn/iws/cas/login?appId=3874dcb953f184dc75450e33d6d6d4fa&service=http://sgwpdm.ah.sgcc.com.cn/iws/mall-view/', + ) + }, 500) + } } // 查看消息