ruoyi-plus-soybean/.env-config.ts
elliotliu ebe2c56348
proxy fail fix
修改代理地址缺少/导致代理失败问题
2023-03-07 15:51:07 +08:00

31 lines
653 B
TypeScript

/** 请求服务的环境配置 */
type ServiceEnv = Record<ServiceEnvType, ServiceEnvConfig>;
/** 不同请求服务的环境配置 */
const serviceEnv: ServiceEnv = {
dev: {
url: 'http://localhost:8080'
},
test: {
url: 'http://localhost:8080'
},
prod: {
url: 'http://localhost:8080'
}
};
/**
* 获取当前环境模式下的请求服务的配置
* @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'
};
}