fix(site): 按 Host 注入租户标题与 SEO 信息

This commit is contained in:
2026-11-19 16:54:50 +08:00
parent e80a461182
commit 3492ecbe9b
12 changed files with 969 additions and 28 deletions
+12 -3
View File
@@ -473,9 +473,18 @@ export const useDistributionSiteStore = defineStore('distributionSite', {
sessionStorage.removeItem('hfb_site_name')
localStorage.removeItem('hfb_site_code')
localStorage.removeItem('hfb_site_name')
document.title = '大锤商行 - 官方租号平台'
this.faviconUrl = siteBrandFor('dachui').favicon
this.applyFavicon()
// 服务端注入或静态 bootstrap 已经给出正确品牌时,不要因为接口失败
// 把经营租户域名回退成主站标题和图标。
const serverInjected =
typeof document !== 'undefined' &&
document.querySelector('meta[name="site-shell"]') !== null
const bootstrapped =
typeof document !== 'undefined' && Boolean(document.documentElement.dataset.siteBootstrap)
if (!serverInjected && !bootstrapped) {
document.title = '大锤商行 - 官方租号平台'
this.faviconUrl = siteBrandFor('dachui').favicon
this.applyFavicon()
}
},
applyTenantContext(info: TenantSiteContext) {