mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(projects): update service and proxy config
This commit is contained in:
@ -4,22 +4,13 @@ type ServiceEnv = Record<ServiceEnvType, ServiceEnvConfig>;
|
||||
/** 不同请求服务的环境配置 */
|
||||
const serviceEnv: ServiceEnv = {
|
||||
dev: {
|
||||
url: 'http://localhost:8080',
|
||||
urlPattern: '/url-pattern',
|
||||
secondUrl: 'http://localhost:8081',
|
||||
secondUrlPattern: '/second-url-pattern'
|
||||
url: 'http://localhost:8080'
|
||||
},
|
||||
test: {
|
||||
url: 'http://localhost:8080',
|
||||
urlPattern: '/url-pattern',
|
||||
secondUrl: 'http://localhost:8081',
|
||||
secondUrlPattern: '/second-url-pattern'
|
||||
url: 'http://localhost:8080'
|
||||
},
|
||||
prod: {
|
||||
url: 'http://localhost:8080',
|
||||
urlPattern: '/url-pattern',
|
||||
secondUrl: 'http://localhost:8081',
|
||||
secondUrlPattern: '/second-url-pattern'
|
||||
url: 'http://localhost:8080'
|
||||
}
|
||||
};
|
||||
|
||||
@ -27,10 +18,13 @@ const serviceEnv: ServiceEnv = {
|
||||
* 获取当前环境模式下的请求服务的配置
|
||||
* @param env 环境
|
||||
*/
|
||||
export function getServiceEnvConfig(env: ImportMetaEnv) {
|
||||
export function getServiceEnvConfig(env: ImportMetaEnv): ServiceEnvConfigWithProxyPattern {
|
||||
const { VITE_SERVICE_ENV = 'dev' } = env;
|
||||
|
||||
const config = serviceEnv[VITE_SERVICE_ENV];
|
||||
|
||||
return config;
|
||||
return {
|
||||
...config,
|
||||
proxyPattern: 'proxy-pattern'
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user