fix: 其他配置/9610 默认 API 按当前环境解析,避免测试站写死正式域名
All checks were successful
Build and Deploy Front / deploy (push) Successful in 5m44s
All checks were successful
Build and Deploy Front / deploy (push) Successful in 5m44s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
1bc2838def
commit
08ceb34b3b
@ -19,6 +19,7 @@ import {
|
|||||||
} from '@/api/order/customs9610'
|
} from '@/api/order/customs9610'
|
||||||
import { $baseMessage } from '@/utils'
|
import { $baseMessage } from '@/utils'
|
||||||
import { hasPermission } from '@/utils/rbac-permission'
|
import { hasPermission } from '@/utils/rbac-permission'
|
||||||
|
import { prodApiOrigin } from '@/utils/rewriteBrowserApiPath'
|
||||||
import { formatDateTime, normalizeListRow, pickField } from '@/utils/warehouseListMapper'
|
import { formatDateTime, normalizeListRow, pickField } from '@/utils/warehouseListMapper'
|
||||||
import { renderWarehouseActionBtn, wrapWarehouseActions } from '@/utils/warehouseActionRenderer'
|
import { renderWarehouseActionBtn, wrapWarehouseActions } from '@/utils/warehouseActionRenderer'
|
||||||
import SlidingTabs from '@/components/SlidingTabs/index.vue'
|
import SlidingTabs from '@/components/SlidingTabs/index.vue'
|
||||||
@ -538,7 +539,7 @@ function formatDownstreamForwardResult(item: Record<string, unknown>): string {
|
|||||||
`standardCode:create9610Order`,
|
`standardCode:create9610Order`,
|
||||||
`supplierCode:BH`,
|
`supplierCode:BH`,
|
||||||
`消息:${pickField(item, 'message', 'Message') || '-'}`,
|
`消息:${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')
|
const requestJson = pickField(item, 'requestJson', 'RequestJson')
|
||||||
if (requestJson) {
|
if (requestJson) {
|
||||||
|
|||||||
@ -208,6 +208,7 @@ import {
|
|||||||
updateSystemOtherConfig,
|
updateSystemOtherConfig,
|
||||||
type SystemOtherConfigDto,
|
type SystemOtherConfigDto,
|
||||||
} from '@/api/system/otherConfig'
|
} from '@/api/system/otherConfig'
|
||||||
|
import { prodApiOrigin } from '@/utils/rewriteBrowserApiPath'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'SystemOtherConfig',
|
name: 'SystemOtherConfig',
|
||||||
@ -215,6 +216,17 @@ defineOptions({
|
|||||||
|
|
||||||
const { t } = useI18n()
|
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<SystemOtherConfigDto[]>([])
|
const list = ref<SystemOtherConfigDto[]>([])
|
||||||
const modalVisible = ref(false)
|
const modalVisible = ref(false)
|
||||||
const modalLoading = ref(false)
|
const modalLoading = ref(false)
|
||||||
@ -250,7 +262,7 @@ const PRESET_DEFS: Array<{
|
|||||||
defaults: {
|
defaults: {
|
||||||
configCode: TRACK_SERVICE_CONFIG_CODE,
|
configCode: TRACK_SERVICE_CONFIG_CODE,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
baseUrl: 'https://api.ideship.com/track',
|
baseUrl: `${defaultApiOrigin()}/track`,
|
||||||
timeoutSeconds: 30,
|
timeoutSeconds: 30,
|
||||||
},
|
},
|
||||||
meta: {
|
meta: {
|
||||||
@ -269,7 +281,7 @@ const PRESET_DEFS: Array<{
|
|||||||
defaults: {
|
defaults: {
|
||||||
configCode: API_CENTER_CONFIG_CODE,
|
configCode: API_CENTER_CONFIG_CODE,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
baseUrl: 'https://api.ideship.com/itfx',
|
baseUrl: `${defaultApiOrigin()}/itfx`,
|
||||||
timeoutSeconds: 30,
|
timeoutSeconds: 30,
|
||||||
},
|
},
|
||||||
meta: {
|
meta: {
|
||||||
@ -290,7 +302,7 @@ const PRESET_DEFS: Array<{
|
|||||||
defaults: {
|
defaults: {
|
||||||
configCode: WECHAT_MP_CONFIG_CODE,
|
configCode: WECHAT_MP_CONFIG_CODE,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
baseUrl: 'https://ideship.com',
|
baseUrl: defaultSiteOrigin(),
|
||||||
timeoutSeconds: 30,
|
timeoutSeconds: 30,
|
||||||
},
|
},
|
||||||
meta: {
|
meta: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user