feat: 端切换的时候切换环境

This commit is contained in:
2025-09-22 23:32:03 +08:00
parent dfaed6188b
commit 96746df7c9
2 changed files with 5 additions and 2 deletions

View File

@@ -42,3 +42,6 @@ export const CLIENT_CONFIGS = processConfigs(rawConfigs);
export const getCurrentConfig = () => CLIENT_CONFIGS.tianmu; export const getCurrentConfig = () => CLIENT_CONFIGS.tianmu;
export const clientId = getCurrentConfig().clientId; export const clientId = getCurrentConfig().clientId;
export const appId = getCurrentConfig().appId; export const appId = getCurrentConfig().appId;
// 环境配置 - 智念客户端使用测试环境,其他客户端使用生产环境
export const isProd = getCurrentConfig().name !== '智念';

View File

@@ -1,4 +1,4 @@
const isProd = true; import { isProd } from '@/constant/base.js';
// 测试 // 测试
const VITE_BASE_URL_TEST = "https://onefeel.brother7.cn/ingress"; const VITE_BASE_URL_TEST = "https://onefeel.brother7.cn/ingress";
@@ -8,7 +8,7 @@ const VITE_WSS_URL_TEST = "wss://onefeel.brother7.cn/ingress/agent/ws/chat";
const VITE_BASE_URL_PRO = "https://biz.nianxx.cn"; const VITE_BASE_URL_PRO = "https://biz.nianxx.cn";
const VITE_WSS_URL_PRO = "wss://biz.nianxx.cn/agent/ws/chat"; const VITE_WSS_URL_PRO = "wss://biz.nianxx.cn/agent/ws/chat";
// 环境配置 // 环境配置 - 根据客户端配置动态决定环境
export const BASE_URL = isProd ? VITE_BASE_URL_PRO : VITE_BASE_URL_TEST; export const BASE_URL = isProd ? VITE_BASE_URL_PRO : VITE_BASE_URL_TEST;
export const WSS_URL = isProd ? VITE_WSS_URL_PRO : VITE_WSS_URL_TEST; export const WSS_URL = isProd ? VITE_WSS_URL_PRO : VITE_WSS_URL_TEST;