chore(domain): 官网域名切 gxhuijicai.com,后端 API 迁 hjc-api.websoft.top

- nuxt.config.ts:API 默认值 → hjc-api.websoft.top;主域清单与 allowedHosts
  加入 gxhuijicai.com(居首;shoplnk/sitelink/wsdns 平台遗留主域共存保留);
  preconnect/dns-prefetch 同步
- .env.production / .env.development / .env.example / README / scripts 默认值同步
This commit is contained in:
2026-09-30 07:55:59 +08:00
parent b88c9df3b3
commit 85207e1648
7 changed files with 30 additions and 29 deletions
+10 -9
View File
@@ -28,21 +28,22 @@ const siteName = process.env.NUXT_PUBLIC_SITE_NAME || ''
const modulesApiBase =
process.env.NUXT_PUBLIC_MODULES_API_BASE ||
'https://hjc-api.sitelnk.cn/api'
'https://hjc-api.websoft.top/api'
const appApiBase =
process.env.NUXT_PUBLIC_APP_API_BASE ||
'https://hjc-api.sitelnk.cn'
'https://hjc-api.websoft.top'
const fileServerBase =
process.env.NUXT_PUBLIC_FILE_SERVER_BASE ||
getOrigin(appApiBase) ||
'https://hjc-api.sitelnk.cn'
'https://hjc-api.websoft.top'
const baseDomain =
process.env.NUXT_PUBLIC_BASE_DOMAIN || 'shoplnk.cn'
process.env.NUXT_PUBLIC_BASE_DOMAIN || 'gxhuijicai.com'
// 多主域清单:子域名租户解析支持的主域(逗号分隔)。
// 默认 shoplnk.cn,sitelink.cn,wsdns.cn;baseDomain 仅作兼容保留(取第一个)。
// 默认 gxhuijicai.com(官网主域)居首,shoplnk.cn/sitelink.cn/wsdns.cn 为平台遗留主域共存保留;
// baseDomain 仅作兼容保留(取第一个)。
const baseDomains = (
process.env.NUXT_PUBLIC_BASE_DOMAINS ||
'shoplnk.cn,sitelink.cn,wsdns.cn'
'gxhuijicai.com,shoplnk.cn,sitelink.cn,wsdns.cn'
).split(',').map(s => s.trim()).filter(Boolean)
// 子域名前缀白名单:仅这些前缀 + 数字租户号 + 主域 会被识别为平台子域名租户
const subdomainPrefixes = (
@@ -80,8 +81,8 @@ export default defineNuxtConfig({
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
// 提前与接口/图片源站建立连接,降低首字节与图片加载延迟
{ rel: 'preconnect', href: 'https://hjc-api.sitelnk.cn', crossorigin: '' },
{ rel: 'dns-prefetch', href: 'https://hjc-api.sitelnk.cn' },
{ rel: 'preconnect', href: 'https://hjc-api.websoft.top', crossorigin: '' },
{ rel: 'dns-prefetch', href: 'https://hjc-api.websoft.top' },
{ rel: 'preconnect', href: 'https://file.wsdns.cn', crossorigin: '' },
{ rel: 'dns-prefetch', href: 'https://file.wsdns.cn' },
// 思源黑体(Noto Sans SC,SIL 开源许可,版权无忧)网页字体,全站统一字体
@@ -146,7 +147,7 @@ export default defineNuxtConfig({
// 以 "." 开头的条目表示允许该域名及其所有子域。
// 注意:这里只是放宽 Vite 的 host 校验,真正「是否解析为合法租户」仍由
// tenant 中间件按白名单前缀 + 主域清单判断;非白名单子域不会命中租户。
allowedHosts: ['.shoplnk.cn', '.sitelink.cn', '.wsdns.cn', 'localhost', '127.0.0.1'],
allowedHosts: ['.gxhuijicai.com', '.shoplnk.cn', '.sitelink.cn', '.wsdns.cn', 'localhost', '127.0.0.1'],
watch: {
ignored: WATCH_IGNORED
}