diff --git a/.env.development b/.env.development index 8865a7e..b85236a 100644 --- a/.env.development +++ b/.env.development @@ -26,8 +26,8 @@ NUXT_PUBLIC_APP_API_BASE=http://127.0.0.1:9200 # NUXT_PUBLIC_FILE_SERVER_BASE=http://127.0.0.1:9200 # ---------- 站点 / 多租户域名 ---------- -NUXT_PUBLIC_BASE_DOMAIN=shoplnk.cn -NUXT_PUBLIC_BASE_DOMAINS=shoplnk.cn,sitelink.cn,wsdns.cn +NUXT_PUBLIC_BASE_DOMAIN=gxhuijicai.com +NUXT_PUBLIC_BASE_DOMAINS=gxhuijicai.com,shoplnk.cn,sitelink.cn,wsdns.cn NUXT_PUBLIC_SUBDOMAIN_PREFIXES=site,shop,store,mp,app,oa # ---------- 可选覆盖(留空 = 由后台配置决定) ---------- diff --git a/.env.example b/.env.example index a64d18e..53d5c97 100644 --- a/.env.example +++ b/.env.example @@ -26,9 +26,9 @@ NUXT_PUBLIC_TEMPLATE_ID= NUXT_PUBLIC_FORCE_TEMPLATE_ID= # ---------- 后端接口地址 ---------- -# 内容/CMS 接口。生产为 https://hjc-api.sitelnk.cn/api +# 内容/CMS 接口。生产为 https://hjc-api.websoft.top/api NUXT_PUBLIC_MODULES_API_BASE= -# 租户/模板解析接口。生产为 https://hjc-api.sitelnk.cn(无 /api 后缀) +# 租户/模板解析接口。生产为 https://hjc-api.websoft.top(无 /api 后缀) NUXT_PUBLIC_APP_API_BASE= # 图片/文件服务器。留空则从 APP_API_BASE 自动推导 NUXT_PUBLIC_FILE_SERVER_BASE= @@ -36,7 +36,7 @@ NUXT_PUBLIC_FILE_SERVER_BASE= # ---------- 多租户域名 ---------- # 兼容保留,实际取 BASE_DOMAINS 的第一个 NUXT_PUBLIC_BASE_DOMAIN= -# 多主域清单,逗号分隔 +# 多主域清单,逗号分隔(官网主域 gxhuijicai.com 居首;shoplnk.cn 等为平台遗留主域) NUXT_PUBLIC_BASE_DOMAINS= # 子域名前缀白名单(这些前缀 + 数字租户号 + 主域 才被识别为平台子域租户) NUXT_PUBLIC_SUBDOMAIN_PREFIXES= diff --git a/.env.production b/.env.production index 58032d7..3efcee6 100644 --- a/.env.production +++ b/.env.production @@ -6,18 +6,18 @@ # ============================================================ # ---------- 接口(生产必须指向线上) ---------- -# 单一后端:内容/CMS、租户解析、模板解析全部走 hjc-api -NUXT_PUBLIC_MODULES_API_BASE=https://hjc-api.sitelnk.cn/api -NUXT_PUBLIC_APP_API_BASE=https://hjc-api.sitelnk.cn +# 单一后端(已迁移):内容/CMS、租户解析、模板解析全部走 hjc-api.websoft.top +NUXT_PUBLIC_MODULES_API_BASE=https://hjc-api.websoft.top/api +NUXT_PUBLIC_APP_API_BASE=https://hjc-api.websoft.top # 图片/文件服务器。留空则由 nuxt.config.ts 从 APP_API_BASE 推导出 -# https://hjc-api.sitelnk.cn,无需手写 +# https://hjc-api.websoft.top,无需手写 NUXT_PUBLIC_FILE_SERVER_BASE= # ---------- 站点 / 多租户域名 ---------- # 生产通过域名自动识别租户,因此不设置 TENANT_ID / TEMPLATE_ID, # 也不设置 FORCE_TEMPLATE_ID,避免写死租户导致所有域名串号 -NUXT_PUBLIC_BASE_DOMAIN=shoplnk.cn -NUXT_PUBLIC_BASE_DOMAINS=shoplnk.cn,sitelink.cn,wsdns.cn +NUXT_PUBLIC_BASE_DOMAIN=gxhuijicai.com +NUXT_PUBLIC_BASE_DOMAINS=gxhuijicai.com,shoplnk.cn,sitelink.cn,wsdns.cn NUXT_PUBLIC_SUBDOMAIN_PREFIXES=site,shop,store,mp,app,oa # ---------- 可选覆盖(留空 = 由后台配置决定) ---------- diff --git a/README.md b/README.md index cf542b2..a45d613 100644 --- a/README.md +++ b/README.md @@ -104,15 +104,15 @@ NUXT_PUBLIC_TENANT_ID= NUXT_PUBLIC_APP_ID=42 NUXT_PUBLIC_TEMPLATE_ID= -# 接口地址(单一后端:内容/CMS、租户解析、模板解析全部走 hjc-api) -NUXT_PUBLIC_MODULES_API_BASE=https://hjc-api.sitelnk.cn/api -NUXT_PUBLIC_APP_API_BASE=https://hjc-api.sitelnk.cn +# 接口地址(单一后端:内容/CMS、租户解析、模板解析全部走 hjc-api.websoft.top) +NUXT_PUBLIC_MODULES_API_BASE=https://hjc-api.websoft.top/api +NUXT_PUBLIC_APP_API_BASE=https://hjc-api.websoft.top -# 多租户域名 -NUXT_PUBLIC_BASE_DOMAINS=shoplnk.cn,sitelink.cn,wsdns.cn +# 多租户域名(官网主域 gxhuijicai.com 居首;其余为平台遗留主域,共存保留) +NUXT_PUBLIC_BASE_DOMAINS=gxhuijicai.com,shoplnk.cn,sitelink.cn,wsdns.cn ``` -> ℹ️ `nuxt.config.ts` 内置的接口默认值已统一为 `https://hjc-api.sitelnk.cn`(单后端)。 +> ℹ️ `nuxt.config.ts` 内置的接口默认值已统一为 `https://hjc-api.websoft.top`(单后端)。 > `.env.production` 中也显式指定同一地址。 > 若将来再次更换域名,请同步修改 `nuxt.config.ts`、`.env.production` 与 `.env.example`。 @@ -139,7 +139,7 @@ npm run build npm run preview ``` -生产环境建议使用 Nginx 反向代理,配置泛域名 `*.shoplnk.cn` 指向 Nuxt 服务。 +生产环境建议使用 Nginx 反向代理,配置泛域名 `*.gxhuijicai.com` 指向 Nuxt 服务。 ## 注意事项 diff --git a/nuxt.config.ts b/nuxt.config.ts index 648ddc9..01b96c1 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -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 } diff --git a/scripts/cms_fill_image.py b/scripts/cms_fill_image.py index ae8363d..7f6b76f 100644 --- a/scripts/cms_fill_image.py +++ b/scripts/cms_fill_image.py @@ -7,7 +7,7 @@ import os, json, sys, subprocess, time, urllib.request, urllib.error TOKEN = os.environ.get("TOKEN", "") UPLOAD = "https://server.websoft.top/api/file/upload" -CMS = "https://hjc-api.sitelnk.cn/api" +CMS = "https://hjc-api.websoft.top/api" FILE_BASE = "https://file.websoft.top/api/file/" HDR = {"TenantId": "10626", "Authorization": "Bearer " + TOKEN} diff --git a/scripts/publish-cms-content.mjs b/scripts/publish-cms-content.mjs index 1684369..f4db164 100644 --- a/scripts/publish-cms-content.mjs +++ b/scripts/publish-cms-content.mjs @@ -25,7 +25,7 @@ * ============================================================================ */ -const API_BASE = process.env.CMS_API_BASE || 'https://hjc-api.sitelnk.cn/api' +const API_BASE = process.env.CMS_API_BASE || 'https://hjc-api.websoft.top/api' const TOKEN_RAW = process.env.ADMIN_TOKEN || '' const TENANT_ID = process.env.TENANT_ID || '10546' const APPLY = process.env.APPLY === '1'