优化后端服务地址配置,新增VITE_NEW_API_URL环境变量用于新功能服务,统一管理主服务(8808端口)和新功能服务(8000端口)的地址配置,在开发环境配置文件和订阅页面中添加详细的地址用途说明和环境切换注释,同时将newService实例的硬编码地址改为使用环境变量以便统一管理

This commit is contained in:
WUSIJIAN
2026-01-23 16:26:16 +08:00
parent a16081f1fa
commit 88ecabd1db
3 changed files with 27 additions and 11 deletions

View File

@@ -24,7 +24,12 @@ const showErrorMessage = (message: string) => {
ElMessage.error(message);
};
// 配置新建第一个 axios 实例(原来的主服务)
// ============================================================
// Axios 实例配置
// 地址配置见 .env.development 文件
// ============================================================
// 主服务实例端口8808- 系统管理、用户认证、权限、模块开通等
const service: AxiosInstance = axios.create({
baseURL: import.meta.env.VITE_API_URL,
timeout: 50000,
@@ -36,10 +41,9 @@ const service: AxiosInstance = axios.create({
},
});
// 配置新建第二个 axios 实例(新功能服务)
// 新功能服务实例端口8000- 资产管理、分类、SKU、订单等新模块
const newService: AxiosInstance = axios.create({
baseURL: 'http://192.168.3.200:8000/',
// baseURL: 'http://192.168.3.11:8000/',
baseURL: import.meta.env.VITE_NEW_API_URL,
timeout: 50000,
headers: { 'Content-Type': 'application/json' },
paramsSerializer: {