refactor(cms): 迁移CMS模块接口到独立cms-api服务

- 新增cmsRequest工具,基于request封装,默认baseURL为cms-api
- 改用cmsRequest替换所有cms相关请求,确保请求走独立域名
- 配置三环境新增CMS_API_BASE_URL及导出CmsBaseUrl常量
- 解决CMS接口走shop-api时返回404的问题,避免小程序域名白名单冲突
- 统一修改34个cms API模块的261处调用,保持接口行为一致
- 修复部分拼接全URL方式改为相对路径调用cmsRequest
- 更新注释说明并调整相关接口调用代码
- 兼容macOS sed替换问题,采用perl命令完成批量替换
This commit is contained in:
2026-08-11 11:04:40 +08:00
parent 2e80a49ca1
commit b4cd54e102
42 changed files with 450 additions and 370 deletions
+4 -1
View File
@@ -5,6 +5,7 @@ export const ENV_CONFIG = {
API_BASE_URL: 'https://shop-api.websoft.top/api',
SERVER_API_URL: 'https://server.websoft.top/api',
WEBSOPY_API_BASE_URL: 'https://websopy-api.websoft.top/api',
CMS_API_BASE_URL: 'https://cms-api.websoft.top/api',
APP_NAME: '威数谱软件',
DEBUG: 'true',
},
@@ -12,6 +13,7 @@ export const ENV_CONFIG = {
API_BASE_URL: 'https://shop-api.websoft.top/api',
SERVER_API_URL: 'https://server.websoft.top/api',
WEBSOPY_API_BASE_URL: 'https://websopy-api.websoft.top/api',
CMS_API_BASE_URL: 'https://cms-api.websoft.top/api',
APP_NAME: '威数谱软件',
DEBUG: 'true',
},
@@ -19,6 +21,7 @@ export const ENV_CONFIG = {
API_BASE_URL: 'https://shop-api.websoft.top/api',
SERVER_API_URL: 'https://server.websoft.top/api',
WEBSOPY_API_BASE_URL: 'https://websopy-api.websoft.top/api',
CMS_API_BASE_URL: 'https://cms-api.websoft.top/api',
APP_NAME: '威数谱软件',
DEBUG: 'false',
},
@@ -28,4 +31,4 @@ export function getEnvConfig() {
return ENV_CONFIG[CURRENT_ENV] || ENV_CONFIG.development
}
export const { API_BASE_URL, SERVER_API_URL, WEBSOPY_API_BASE_URL, APP_NAME, DEBUG } = getEnvConfig()
export const { API_BASE_URL, SERVER_API_URL, WEBSOPY_API_BASE_URL, CMS_API_BASE_URL, APP_NAME, DEBUG } = getEnvConfig()