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:05:22 +08:00
parent b4cd54e102
commit d085e02ecf
3 changed files with 30 additions and 66 deletions
+8 -5
View File
@@ -1,6 +1,5 @@
import React from 'react'
import { View, Text } from '@tarojs/components'
import { Button } from '@nutui/nutui-react-taro'
import { View, Text, Button } from '@tarojs/components'
interface EmptyStateProps {
image?: string
@@ -33,9 +32,13 @@ const EmptyState: React.FC<EmptyStateProps> = ({
)}
{actionText && onAction && (
<Button
type='primary'
size='small'
className='mt-4 rounded-full px-6'
size='mini'
className='mt-4 bg-red-500 text-white rounded-full border-0 text-xs'
style={{
paddingLeft: '24px',
paddingRight: '24px',
lineHeight: '30px',
}}
onClick={onAction}
>
{actionText}
+9 -8
View File
@@ -1,6 +1,5 @@
import React from 'react'
import { View } from '@tarojs/components'
import { Button } from '@nutui/nutui-react-taro'
import { View, Button } from '@tarojs/components'
interface FixedButtonProps {
text?: string
@@ -24,15 +23,17 @@ const FixedButton: React.FC<FixedButtonProps> = ({ text, onClick, icon, disabled
style={{ paddingBottom: '12px', flexShrink: 0 }}
>
<Button
type="primary"
style={{ background }}
size="large"
block
icon={icon}
disabled={disabled}
className="px-6"
onClick={onClick}
style={{
background: background || '#ef4444',
height: '44px',
lineHeight: '44px',
opacity: disabled ? 0.5 : 1,
}}
className="w-full flex items-center justify-center text-white text-base font-medium rounded-full border-0 px-6"
>
{icon ? <View className="mr-1 flex items-center">{icon}</View> : null}
{text || '确定'}
</Button>
</View>