123456789101112131415161718192021222324252627282930 |
- /** 请求服务的环境配置 */
- type ServiceEnv = Record<ServiceEnvType, ServiceEnvConfig>;
- /** 不同请求服务的环境配置 */
- const serviceEnv: ServiceEnv = {
- dev: {
- url: 'http://192.168.1.70:8000'
- },
- test: {
- url: 'http://192.168.1.70:8000'
- },
- prod: {
- url: 'http://192.168.1.70:8000'
- }
- };
- /**
- * 获取当前环境模式下的请求服务的配置
- * @param env 环境
- */
- export function getServiceEnvConfig(env: ImportMetaEnv): ServiceEnvConfigWithProxyPattern {
- const { VITE_SERVICE_ENV = 'dev' } = env;
- const config = serviceEnv[VITE_SERVICE_ENV];
- return {
- ...config,
- proxyPattern: '/proxy-pattern'
- };
- }
|