diff --git a/src/views/order/customs9610Order/index.vue b/src/views/order/customs9610Order/index.vue index c536ca4..6718933 100644 --- a/src/views/order/customs9610Order/index.vue +++ b/src/views/order/customs9610Order/index.vue @@ -19,6 +19,7 @@ import { } from '@/api/order/customs9610' import { $baseMessage } from '@/utils' import { hasPermission } from '@/utils/rbac-permission' +import { prodApiOrigin } from '@/utils/rewriteBrowserApiPath' import { formatDateTime, normalizeListRow, pickField } from '@/utils/warehouseListMapper' import { renderWarehouseActionBtn, wrapWarehouseActions } from '@/utils/warehouseActionRenderer' import SlidingTabs from '@/components/SlidingTabs/index.vue' @@ -538,7 +539,7 @@ function formatDownstreamForwardResult(item: Record): string { `standardCode:create9610Order`, `supplierCode:BH`, `消息:${pickField(item, 'message', 'Message') || '-'}`, - `请求:${pickField(item, 'url', 'Url') || 'https://api.ideship.com/itfx/InterfaceForward/ForwardWithSubscribe?standardCode=create9610Order&supplierCode=BH'}`, + `请求:${pickField(item, 'url', 'Url') || `${prodApiOrigin()}/itfx/InterfaceForward/ForwardWithSubscribe?standardCode=create9610Order&supplierCode=BH`}`, ] const requestJson = pickField(item, 'requestJson', 'RequestJson') if (requestJson) { diff --git a/src/views/system/otherConfig/index.vue b/src/views/system/otherConfig/index.vue index d4b6fae..34dc55e 100644 --- a/src/views/system/otherConfig/index.vue +++ b/src/views/system/otherConfig/index.vue @@ -208,6 +208,7 @@ import { updateSystemOtherConfig, type SystemOtherConfigDto, } from '@/api/system/otherConfig' +import { prodApiOrigin } from '@/utils/rewriteBrowserApiPath' defineOptions({ name: 'SystemOtherConfig', @@ -215,6 +216,17 @@ defineOptions({ const { t } = useI18n() +function defaultSiteOrigin(): string { + if (typeof window !== 'undefined' && window.location?.origin) { + return window.location.origin.replace(/\/$/, '') + } + return 'https://test.ideship.com' +} + +function defaultApiOrigin(): string { + return prodApiOrigin() +} + const list = ref([]) const modalVisible = ref(false) const modalLoading = ref(false) @@ -250,7 +262,7 @@ const PRESET_DEFS: Array<{ defaults: { configCode: TRACK_SERVICE_CONFIG_CODE, enabled: true, - baseUrl: 'https://api.ideship.com/track', + baseUrl: `${defaultApiOrigin()}/track`, timeoutSeconds: 30, }, meta: { @@ -269,7 +281,7 @@ const PRESET_DEFS: Array<{ defaults: { configCode: API_CENTER_CONFIG_CODE, enabled: true, - baseUrl: 'https://api.ideship.com/itfx', + baseUrl: `${defaultApiOrigin()}/itfx`, timeoutSeconds: 30, }, meta: { @@ -290,7 +302,7 @@ const PRESET_DEFS: Array<{ defaults: { configCode: WECHAT_MP_CONFIG_CODE, enabled: true, - baseUrl: 'https://ideship.com', + baseUrl: defaultSiteOrigin(), timeoutSeconds: 30, }, meta: {