refactor(config): 将环境配置中的baseURL改为使用/api路径
统一各环境的API请求路径为相对路径/api,以便通过Vite代理处理请求,简化环境配置并提高开发体验
This commit is contained in:
parent
98ab612abb
commit
25905fdc83
|
|
@ -6,24 +6,24 @@ const defaultConfig = {
|
||||||
timeout: 20000,
|
timeout: 20000,
|
||||||
debug: false
|
debug: false
|
||||||
};
|
};
|
||||||
|
// https://nx.smartjinrui.cn
|
||||||
// 开发环境配置
|
// 开发环境配置
|
||||||
export const developmentConfig = {
|
export const developmentConfig = {
|
||||||
...defaultConfig,
|
...defaultConfig,
|
||||||
baseURL: 'https://nx.smartjinrui.cn', // 使用相对路径,让请求经过Vite代理
|
baseURL: '/api', // 使用相对路径,让请求经过Vite代理
|
||||||
debug: true
|
debug: true
|
||||||
};
|
};
|
||||||
|
|
||||||
// 测试环境配置
|
// 测试环境配置
|
||||||
export const testConfig = {
|
export const testConfig = {
|
||||||
...defaultConfig,
|
...defaultConfig,
|
||||||
baseURL: 'https://nx.smartjinrui.cn'
|
baseURL: '/api'
|
||||||
};
|
};
|
||||||
|
|
||||||
// 生产环境配置
|
// 生产环境配置
|
||||||
export const productionConfig = {
|
export const productionConfig = {
|
||||||
...defaultConfig,
|
...defaultConfig,
|
||||||
baseURL: 'https://nx.smartjinrui.cn'
|
baseURL: '/api'
|
||||||
};
|
};
|
||||||
|
|
||||||
// 根据当前环境获取对应的配置
|
// 根据当前环境获取对应的配置
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue