feat: 默认测试环境并优化出仓与网络提示
This commit is contained in:
@@ -26,14 +26,16 @@ const config = {
|
||||
// 开发环境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_DEV_API_URL || 'https://www.haotopai.com/hcscm_weave/mes/server/pda/v1' },
|
||||
{ label: '自定义', value: 'custom' }
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
// 设置后台接口服务的基础地址 - 使用动态API URL
|
||||
// config.baseUrl = 'https://aidex.vip/api'; // 注释掉固定的baseUrl
|
||||
export function getTestApiUrl() {
|
||||
const test = config.devApiUrlOptions.find(item => item.label === '测试环境');
|
||||
return (test && test.value) || 'https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1';
|
||||
}
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -70,8 +70,12 @@ const install = (Vue, vm) => {
|
||||
}
|
||||
console.log('res',res)
|
||||
if (!(res.data)){
|
||||
vm.$u.toast('未连接到服务器')
|
||||
return Promise.reject(new Error('未连接到服务器'));
|
||||
const errMsg = String((res && res.errMsg) || '');
|
||||
const isNetworkError = res.statusCode === -1
|
||||
|| /Unable to resolve host|Failed to connect|request:fail|timeout|网络/i.test(errMsg);
|
||||
const message = isNetworkError ? '当前没有网络,请检查网络后重试' : '未连接到服务器';
|
||||
vm.$u.toast(message)
|
||||
return Promise.reject(new Error(message));
|
||||
}
|
||||
|
||||
if(res.data.code !== 0) {
|
||||
|
||||
@@ -69,8 +69,8 @@ export const BILL_TYPES = [
|
||||
/** 列表分页拉取每页条数 */
|
||||
export const LIST_PAGE_SIZE = 100;
|
||||
|
||||
/** 往来单位类型:织厂(接收单位下拉筛选) */
|
||||
export const BUSINESS_UNIT_TYPE_KNITTING_FACTORY = 11;
|
||||
/** 往来单位类型:染厂(接收单位下拉筛选) */
|
||||
export const BUSINESS_UNIT_TYPE_DYEING_FACTORY = 12;
|
||||
|
||||
export function getStatusOptions() {
|
||||
return Object.keys(AUDIT_STATUS_MAP).map((value) => ({
|
||||
|
||||
Reference in New Issue
Block a user