diff --git a/f/web-kboss/src/router/index.js b/f/web-kboss/src/router/index.js index db1cf56..cc39ae4 100644 --- a/f/web-kboss/src/router/index.js +++ b/f/web-kboss/src/router/index.js @@ -19,7 +19,6 @@ import ShowGpu from "@/views/product/productHome/capitalOnline/productItem/GpuPr import ShowEip from "@/views/product/productHome/capitalOnline/Net/Eip/showEip/index.vue"; import CreateEip from "@/views/product/productHome/capitalOnline/Net/Eip/createEip/index.vue"; import { getHomePath } from '@/views/setting/tools' -import { h } from "vue"; Vue.use(Router); diff --git a/f/web-kboss/src/views/homePage/components/topBox/index.vue b/f/web-kboss/src/views/homePage/components/topBox/index.vue index 1240ebe..ae2b498 100644 --- a/f/web-kboss/src/views/homePage/components/topBox/index.vue +++ b/f/web-kboss/src/views/homePage/components/topBox/index.vue @@ -670,7 +670,11 @@ export default Vue.extend({ // 首页跳转方法 - 根据域名判断跳转到不同的首页 goHome() { - console.log('当前域名:', window.location.href); + console.log('=== goHome 方法开始 ==='); + console.log('当前完整URL:', window.location.href); + console.log('当前hostname:', window.location.hostname); + console.log('isNcmatchDomain判断结果:', this.isNcmatchDomain); + console.log('准备跳转的路径:', this.isNcmatchDomain ? '/ncmatchHome/index' : '/homePage/index'); if (this.isNcmatchDomain) { this.$router.push('/ncmatchHome/index'); diff --git a/f/web-kboss/src/views/setting/tools.js b/f/web-kboss/src/views/setting/tools.js index be6735a..470b497 100644 --- a/f/web-kboss/src/views/setting/tools.js +++ b/f/web-kboss/src/views/setting/tools.js @@ -9,6 +9,9 @@ export function getHomePath() { domain_url = url_link.split('?domain_name=')[1]; } + // 使用 hostname 进行更精确的判断 + const hostname = window.location.hostname || ''; + // 如果是业主机构 if ((domain_url.includes('ncmatch') || domain_url.includes('9527') || @@ -22,12 +25,12 @@ export function getHomePath() { } else if (domain_url.includes('kaiyuancloud') || domain_url.includes('opencomputing') || domain_url.includes('localhost')) { homePath = '/homePage/index' } - }else if(url_link.includes('ncmatch')){ + } else if (hostname.includes('ncmatch.cn')) { homePath = '/ncmatchHome/index' - }else{ + } else { homePath = '/homePage/index' } // this.$message.success("homePath是"+homePath) - console.log("homePath是",homePath) + console.log("getHomePath - hostname:", hostname, "homePath:", homePath) return homePath }