chore(domain): 官网接口基址迁 api.gxhuijicai.com
后端对外域名由 hjc-api.websoft.top 迁到 api.gxhuijicai.com: - nuxt.config.ts 的 modulesApiBase / appApiBase / fileServerBase 默认值, 以及 preconnect / dns-prefetch 提示 - .env.production、.env.example、README 的环境变量说明 - scripts/cms_fill_image.py、scripts/publish-cms-content.mjs 的默认 CMS 地址 - database/template-switch-verification.md、outputs/ 两份快照里的地址表述 注意 appApiBase 同时是 fileServerBase 的来源(nuxt.config.ts 取其 origin, server/api/file/[...path].ts 用它代理文件下载)。已实测新域名与旧域名在 /api/file/** 上行为一致,本次迁移不改变该路径的结果。 已实测新域名对官网用到的接口可达(/api/hjc/** 正常),CORS 预检放行。
This commit is contained in:
+2
-2
@@ -26,9 +26,9 @@ NUXT_PUBLIC_TEMPLATE_ID=
|
||||
NUXT_PUBLIC_FORCE_TEMPLATE_ID=
|
||||
|
||||
# ---------- 后端接口地址 ----------
|
||||
# 内容/CMS 接口。生产为 https://hjc-api.websoft.top/api
|
||||
# 内容/CMS 接口。生产为 https://api.gxhuijicai.com/api
|
||||
NUXT_PUBLIC_MODULES_API_BASE=
|
||||
# 租户/模板解析接口。生产为 https://hjc-api.websoft.top(无 /api 后缀)
|
||||
# 租户/模板解析接口。生产为 https://api.gxhuijicai.com(无 /api 后缀)
|
||||
NUXT_PUBLIC_APP_API_BASE=
|
||||
# 图片/文件服务器。留空则从 APP_API_BASE 自动推导
|
||||
NUXT_PUBLIC_FILE_SERVER_BASE=
|
||||
|
||||
+4
-4
@@ -6,11 +6,11 @@
|
||||
# ============================================================
|
||||
|
||||
# ---------- 接口(生产必须指向线上) ----------
|
||||
# 单一后端(已迁移):内容/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
|
||||
# 单一后端(已迁移):内容/CMS、租户解析、模板解析全部走 api.gxhuijicai.com
|
||||
NUXT_PUBLIC_MODULES_API_BASE=https://api.gxhuijicai.com/api
|
||||
NUXT_PUBLIC_APP_API_BASE=https://api.gxhuijicai.com
|
||||
# 图片/文件服务器。留空则由 nuxt.config.ts 从 APP_API_BASE 推导出
|
||||
# https://hjc-api.websoft.top,无需手写
|
||||
# https://api.gxhuijicai.com,无需手写
|
||||
NUXT_PUBLIC_FILE_SERVER_BASE=
|
||||
|
||||
# ---------- 站点 / 多租户域名 ----------
|
||||
|
||||
@@ -104,15 +104,15 @@ NUXT_PUBLIC_TENANT_ID=
|
||||
NUXT_PUBLIC_APP_ID=42
|
||||
NUXT_PUBLIC_TEMPLATE_ID=
|
||||
|
||||
# 接口地址(单一后端:内容/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
|
||||
# 接口地址(单一后端:内容/CMS、租户解析、模板解析全部走 api.gxhuijicai.com)
|
||||
NUXT_PUBLIC_MODULES_API_BASE=https://api.gxhuijicai.com/api
|
||||
NUXT_PUBLIC_APP_API_BASE=https://api.gxhuijicai.com
|
||||
|
||||
# 多租户域名(官网主域 gxhuijicai.com 居首;其余为平台遗留主域,共存保留)
|
||||
NUXT_PUBLIC_BASE_DOMAINS=gxhuijicai.com,shoplnk.cn,sitelink.cn,wsdns.cn
|
||||
```
|
||||
|
||||
> ℹ️ `nuxt.config.ts` 内置的接口默认值已统一为 `https://hjc-api.websoft.top`(单后端)。
|
||||
> ℹ️ `nuxt.config.ts` 内置的接口默认值已统一为 `https://api.gxhuijicai.com`(单后端)。
|
||||
> `.env.production` 中也显式指定同一地址。
|
||||
> 若将来再次更换域名,请同步修改 `nuxt.config.ts`、`.env.production` 与 `.env.example`。
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
后台 website-admin `_websopy` 代理 → `websopy-api.websoft.top` = **websopy-java**。
|
||||
`CmsTemplateController.use()` 按 `loginUser.getTenantId()` 写 `cms_website.template_id`。
|
||||
- **读路径** `GET /cms/cms-website/getSiteInfo`:
|
||||
公开站 `modulesApiBase` 与 后台 `_cms` 代理 → `hjc-api.sitelnk.cn` = **mp-java**。
|
||||
公开站 `modulesApiBase` 与 后台 `_cms` 代理 → `api.gxhuijicai.com` = **mp-java**。
|
||||
返回 `ShopVo`(站点信息),被 Redis 缓存 1 天(key `SiteInfo:{tenantId}`)。
|
||||
- 两后端**共享同一 Redis**(prod `1Panel-redis-Q1LE`;dev `47.119.165.234`,同密码),
|
||||
故 websopy-java 的 `use()` 清缓存能清掉 mp-java 读的 `SiteInfo:{tenantId}`。
|
||||
|
||||
+5
-5
@@ -28,14 +28,14 @@ const siteName = process.env.NUXT_PUBLIC_SITE_NAME || ''
|
||||
|
||||
const modulesApiBase =
|
||||
process.env.NUXT_PUBLIC_MODULES_API_BASE ||
|
||||
'https://hjc-api.websoft.top/api'
|
||||
'https://api.gxhuijicai.com/api'
|
||||
const appApiBase =
|
||||
process.env.NUXT_PUBLIC_APP_API_BASE ||
|
||||
'https://hjc-api.websoft.top'
|
||||
'https://api.gxhuijicai.com'
|
||||
const fileServerBase =
|
||||
process.env.NUXT_PUBLIC_FILE_SERVER_BASE ||
|
||||
getOrigin(appApiBase) ||
|
||||
'https://hjc-api.websoft.top'
|
||||
'https://api.gxhuijicai.com'
|
||||
const baseDomain =
|
||||
process.env.NUXT_PUBLIC_BASE_DOMAIN || 'gxhuijicai.com'
|
||||
// 多主域清单:子域名租户解析支持的主域(逗号分隔)。
|
||||
@@ -81,8 +81,8 @@ export default defineNuxtConfig({
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
|
||||
// 提前与接口/图片源站建立连接,降低首字节与图片加载延迟
|
||||
{ rel: 'preconnect', href: 'https://hjc-api.websoft.top', crossorigin: '' },
|
||||
{ rel: 'dns-prefetch', href: 'https://hjc-api.websoft.top' },
|
||||
{ rel: 'preconnect', href: 'https://api.gxhuijicai.com', crossorigin: '' },
|
||||
{ rel: 'dns-prefetch', href: 'https://api.gxhuijicai.com' },
|
||||
{ rel: 'preconnect', href: 'https://file.wsdns.cn', crossorigin: '' },
|
||||
{ rel: 'dns-prefetch', href: 'https://file.wsdns.cn' },
|
||||
// 思源黑体(Noto Sans SC,SIL 开源许可,版权无忧)网页字体,全站统一字体
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -43,7 +43,7 @@
|
||||
| `server/api/payment/query.get.ts` | `tenderApiBase/payment/query` | 支付状态查询(复用现有支付查询) |
|
||||
| `server/api/supplier/login.post.ts` 等 | `tenderApiBase/...` | 仅当采用账号密码注册登录时新增 |
|
||||
|
||||
> **双后端兼容**:所有 `tenderApiBase` 走统一 runtimeConfig(`NUXT_TENDER_API_BASE`),默认 `https://hjc-api.sitelnk.cn/api`;若确认交易走 guilixu-java,改 env 即可,前端代码不变。租户头 `TenantId`、JWT 透传沿用现有中间件。
|
||||
> **双后端兼容**:所有 `tenderApiBase` 走统一 runtimeConfig(`NUXT_TENDER_API_BASE`),默认 `https://api.gxhuijicai.com/api`;若确认交易走 guilixu-java,改 env 即可,前端代码不变。租户头 `TenantId`、JWT 透传沿用现有中间件。
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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.websoft.top/api"
|
||||
CMS = "https://api.gxhuijicai.com/api"
|
||||
FILE_BASE = "https://file.websoft.top/api/file/"
|
||||
HDR = {"TenantId": "10626", "Authorization": "Bearer " + TOKEN}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
const API_BASE = process.env.CMS_API_BASE || 'https://hjc-api.websoft.top/api'
|
||||
const API_BASE = process.env.CMS_API_BASE || 'https://api.gxhuijicai.com/api'
|
||||
const TOKEN_RAW = process.env.ADMIN_TOKEN || ''
|
||||
const TENANT_ID = process.env.TENANT_ID || '10546'
|
||||
const APPLY = process.env.APPLY === '1'
|
||||
|
||||
Reference in New Issue
Block a user