feat: 更新正式环境API地址并默认选用

This commit is contained in:
2026-10-30 11:59:10 +08:00
parent a4dbcbe504
commit b1404fdd89
7 changed files with 46 additions and 36 deletions
+6 -6
View File
@@ -21,21 +21,21 @@ const config = {
isDevelopment: isDevelopment,
// 生产环境API URL(服务名段 hcscm_weave)
productionApiUrl: process.env.VUE_APP_PRODUCTION_API_URL || 'https://www.haotopai.com/hcscm_weave/mes/server/pda/v1',
productionApiUrl: process.env.VUE_APP_PRODUCTION_API_URL,
// 开发环境API URL选项(仅替换 //域名/ 后第一个路径段 hcscm → hcscm_weave,不改域名)
devApiUrlOptions: [
{ label: '测试环境', value: 'https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1' },
{ label: '正式环境', value: process.env.VUE_APP_DEV_API_URL || process.env.VUE_APP_PRODUCTION_API_URL || 'https://www.haotopai.com/hcscm_weave/mes/server/pda/v1' },
{ label: '本地环境', value: 'http://192.168.1.66:7010/hcscm_weave/pda/v1' },
{ label: '正式环境', value: process.env.VUE_APP_PRODUCTION_API_URL },
// { label: '本地环境', value: 'http://192.168.1.66:7010/hcscm_weave/pda/v1' },
{ label: '自定义', value: 'custom' }
]
}
export function getTestApiUrl() {
const test = config.devApiUrlOptions.find(item => item.label === '测试环境');
return (test && test.value) || 'https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1';
export function getDefaultApiUrl() {
const prod = config.devApiUrlOptions.find(item => item.label === '正式环境');
return (prod && prod.value) || config.productionApiUrl || 'https://zszc.yushangfangzhi.com/server/hcscm_weave/pda/v1';
}
export default config;