update pay ui

This commit is contained in:
2025-12-13 11:38:19 +08:00
parent 646bc25b4f
commit 235cbf48a8
8 changed files with 567 additions and 28 deletions

View File

@@ -17,19 +17,15 @@
* const response = await fetch(getApiBase() + '/api/users');
*/
export const getApiBase = () => {
// 生产环境使用相对路径
if (process.env.NODE_ENV === 'production') {
return '';
}
// 检查是否定义了 REACT_APP_API_URL包括空字符串
// 使用 !== undefined 而不是 || 运算符,正确处理空字符串
// 优先使用环境变量配置的 API URL
// 生产环境配置为 https://api.valuefrontier.cnCDN 部署后静态资源和 API 分离)
// Mock 模式下配置为空字符串,让 MSW 拦截请求
const apiUrl = process.env.REACT_APP_API_URL;
if (apiUrl !== undefined) {
return apiUrl; // Mock 模式下返回 '',其他情况返回配置的值
return apiUrl;
}
// 未配置时的默认后端地址
// 未配置时的默认后端地址(开发环境)
return 'http://49.232.185.254:5001';
};