diff --git a/apps/daxpay-admin/src/views/payment/channel/alipay/manage/mch/AlipayMchManage.vue b/apps/daxpay-admin/src/views/payment/channel/alipay/manage/mch/AlipayMchManage.vue index 500c583a6..245c30a29 100644 --- a/apps/daxpay-admin/src/views/payment/channel/alipay/manage/mch/AlipayMchManage.vue +++ b/apps/daxpay-admin/src/views/payment/channel/alipay/manage/mch/AlipayMchManage.vue @@ -109,12 +109,12 @@ return; } if (card.route) { + // 仅传 mchNo + channelMchNo, 接收端反查名称等元数据 router.push({ path: card.route, query: { mchNo: mchNo.value, channelMchNo: channelMchNo.value, - channelMerchantId: channelMerchant.value.id, }, }); } diff --git a/apps/daxpay-admin/src/views/payment/channel/alipay/manage/mch/app/AlipayMchAppManage.vue b/apps/daxpay-admin/src/views/payment/channel/alipay/manage/mch/app/AlipayMchAppManage.vue index 342b67663..b36e50f5f 100644 --- a/apps/daxpay-admin/src/views/payment/channel/alipay/manage/mch/app/AlipayMchAppManage.vue +++ b/apps/daxpay-admin/src/views/payment/channel/alipay/manage/mch/app/AlipayMchAppManage.vue @@ -7,6 +7,7 @@ import { IconifyIcon } from '@vben-core/icons'; import { type AlipayMchApp, AlipayMchAppApi } from '#/api/payment/channel/alipay/mch-app.api'; + import { ChannelMerchantApi } from '#/api/payment/global/channel-merchant/channel-merchant.api'; import RouteQueryMissingState from '#/components/route/RouteQueryMissingState.vue'; import { PermCodes } from '#/constants/perm-codes'; import { ProductEnum } from '#/enums/payment/productEnum'; @@ -33,12 +34,6 @@ }), fallbackPath: computed(() => { const mchNo = normalizeRouteQueryValue(route.query.mchNo); - const id = normalizeRouteQueryValue(route.query.channelMerchantId); - // product 由本页所属渠道决定(支付宝直连),无需从路由读取 - const product = ProductEnum.ALIPAY; - if (mchNo && id) { - return { path: '/payment/global/channel-merchant/detail', query: { mchNo, id, product } }; - } return mchNo ? { path: '/payment/global/channel-merchant', query: { mchNo } } : '/payment/merchant'; }), }); @@ -47,6 +42,7 @@ const mchNo = ref(''); const channelMchNo = ref(''); const channelMerchantName = ref(''); + const channelMerchantId = ref(''); const appList = ref([]); const editRef = ref>(); const detailRef = ref>(); @@ -79,18 +75,31 @@ } mchNo.value = routeContext.query.value.mchNo; channelMchNo.value = routeContext.query.value.channelMchNo; - channelMerchantName.value = normalizeRouteQueryValue(route.query.channelMerchantName); + } + + /** 反查通道商户元数据(名称/主键), 替代 URL 透传, 保证数据实时 */ + function loadMerchantMeta() { + if (!mchNo.value || !channelMchNo.value) { + return; + } + ChannelMerchantApi.findAllByMchNo(mchNo.value) + .then(({ data }) => { + const merchant = (data || []).find((m) => m.channelMchNo === channelMchNo.value); + if (merchant) { + channelMerchantName.value = merchant.channelMerchantName ?? ''; + channelMerchantId.value = String(merchant.id ?? ''); + } + }); } /** 返回通道商户详情或列表 */ function handleBack() { - const id = normalizeRouteQueryValue(route.query.channelMerchantId); - if (id) { + if (channelMerchantId.value) { // product 由本页所属渠道决定(支付宝直连) const product = ProductEnum.ALIPAY; router.push({ path: '/payment/global/channel-merchant/detail', - query: { mchNo: mchNo.value, id, product }, + query: { mchNo: mchNo.value, id: channelMerchantId.value, product }, }); } else { router.push({ @@ -118,6 +127,8 @@ return; } loadAppList(); + // 反查通道商户元数据(标题/返回) + loadMerchantMeta(); }); @@ -150,14 +161,6 @@ {{ pageTitle }} - - {{ $t('payment.channel.alipayMchApp.consoleLink') }} - diff --git a/apps/daxpay-admin/src/views/payment/channel/douyin/manage/DouyinDirectMchManage.vue b/apps/daxpay-admin/src/views/payment/channel/douyin/manage/DouyinDirectMchManage.vue index 3c532b82d..86ba0ca70 100644 --- a/apps/daxpay-admin/src/views/payment/channel/douyin/manage/DouyinDirectMchManage.vue +++ b/apps/daxpay-admin/src/views/payment/channel/douyin/manage/DouyinDirectMchManage.vue @@ -115,13 +115,12 @@ keyConfigRef.value?.init(); } if (card.key === 'appManage') { - const id = channelMerchant.value.id; + // 应用管理: 仅传 mchNo + channelMchNo, 接收端反查名称等元数据 router.push({ path: '/payment/global/channel-merchant/douyin-app-manage', query: { mchNo: mchNo.value, channelMchNo: channelMchNo.value, - channelMerchantId: id, }, }); } diff --git a/apps/daxpay-admin/src/views/payment/channel/douyin/manage/app/DouyinMchAppManage.vue b/apps/daxpay-admin/src/views/payment/channel/douyin/manage/app/DouyinMchAppManage.vue index b66db13b1..f733cf189 100644 --- a/apps/daxpay-admin/src/views/payment/channel/douyin/manage/app/DouyinMchAppManage.vue +++ b/apps/daxpay-admin/src/views/payment/channel/douyin/manage/app/DouyinMchAppManage.vue @@ -7,6 +7,7 @@ import { IconifyIcon } from '@vben-core/icons'; import { DouyinMchAppApi, type DouyinMchApp } from '#/api/payment/channel/douyin/mch-app.api'; + import { ChannelMerchantApi } from '#/api/payment/global/channel-merchant/channel-merchant.api'; import RouteQueryMissingState from '#/components/route/RouteQueryMissingState.vue'; import { ProductEnum } from '#/enums/payment/productEnum'; import { PermCodes } from '#/constants/perm-codes'; @@ -33,12 +34,6 @@ }), fallbackPath: computed(() => { const mchNo = normalizeRouteQueryValue(route.query.mchNo); - const id = normalizeRouteQueryValue(route.query.channelMerchantId); - // product 由本页所属渠道决定(抖音直连),无需从路由读取 - const product = ProductEnum.DOUYIN_PAY; - if (mchNo && id) { - return { path: '/payment/global/channel-merchant/detail', query: { mchNo, id, product } }; - } return mchNo ? { path: '/payment/global/channel-merchant', query: { mchNo } } : '/payment/merchant'; @@ -49,6 +44,7 @@ const mchNo = ref(''); const channelMchNo = ref(''); const channelMerchantName = ref(''); + const channelMerchantId = ref(''); const appList = ref([]); const editRef = ref>(); const detailRef = ref>(); @@ -80,17 +76,30 @@ } mchNo.value = routeContext.query.value.mchNo!; channelMchNo.value = routeContext.query.value.channelMchNo!; - channelMerchantName.value = normalizeRouteQueryValue(route.query.channelMerchantName); + } + + /** 反查通道商户元数据(名称/主键), 替代 URL 透传, 保证数据实时 */ + function loadMerchantMeta() { + if (!mchNo.value || !channelMchNo.value) { + return; + } + ChannelMerchantApi.findAllByMchNo(mchNo.value) + .then(({ data }) => { + const merchant = (data || []).find((m) => m.channelMchNo === channelMchNo.value); + if (merchant) { + channelMerchantName.value = merchant.channelMerchantName ?? ''; + channelMerchantId.value = String(merchant.id ?? ''); + } + }); } function handleBack() { - const id = normalizeRouteQueryValue(route.query.channelMerchantId); - if (id) { + if (channelMerchantId.value) { // product 由本页所属渠道决定(抖音直连) const product = ProductEnum.DOUYIN_PAY; router.push({ path: '/payment/global/channel-merchant/detail', - query: { mchNo: mchNo.value, id, product }, + query: { mchNo: mchNo.value, id: channelMerchantId.value, product }, }); } else { router.push({ @@ -118,6 +127,8 @@ return; } loadAppList(); + // 反查通道商户元数据(标题/返回) + loadMerchantMeta(); }); diff --git a/apps/daxpay-admin/src/views/payment/global/channel-merchant-global/ChannelMerchantGlobalList.vue b/apps/daxpay-admin/src/views/payment/global/channel-merchant-global/ChannelMerchantGlobalList.vue index b6eedbef5..739108ef8 100644 --- a/apps/daxpay-admin/src/views/payment/global/channel-merchant-global/ChannelMerchantGlobalList.vue +++ b/apps/daxpay-admin/src/views/payment/global/channel-merchant-global/ChannelMerchantGlobalList.vue @@ -99,7 +99,6 @@ query: { mchNo: record.mchNo!, id: record.id!, - product: record.product || '', }, }); } diff --git a/apps/daxpay-admin/src/views/payment/global/channel-merchant/ChannelMerchantList.vue b/apps/daxpay-admin/src/views/payment/global/channel-merchant/ChannelMerchantList.vue index 0ea641b4a..f4e293620 100644 --- a/apps/daxpay-admin/src/views/payment/global/channel-merchant/ChannelMerchantList.vue +++ b/apps/daxpay-admin/src/views/payment/global/channel-merchant/ChannelMerchantList.vue @@ -100,7 +100,6 @@ query: { mchNo: mchNo.value, id: record.id!, - product: record.product || '', }, }); } diff --git a/apps/daxpay-admin/src/views/payment/global/channel-merchant/detail/ChannelMerchantDetailDispatch.vue b/apps/daxpay-admin/src/views/payment/global/channel-merchant/detail/ChannelMerchantDetailDispatch.vue index 34f06a00f..a5e7b182d 100644 --- a/apps/daxpay-admin/src/views/payment/global/channel-merchant/detail/ChannelMerchantDetailDispatch.vue +++ b/apps/daxpay-admin/src/views/payment/global/channel-merchant/detail/ChannelMerchantDetailDispatch.vue @@ -31,15 +31,12 @@ const router = useRouter(); const routeContext = useRequiredRouteQuery({ - keys: ['mchNo', 'id', 'product'], + keys: ['mchNo', 'id'], messageKey: computed(() => { if (!normalizeRouteQueryValue(route.query.mchNo)) { return 'payment.common.route.missingMchNo'; } - if (!normalizeRouteQueryValue(route.query.id)) { - return 'payment.merchant.channelMerchant.missingId'; - } - return 'payment.common.route.missingProduct'; + return 'payment.merchant.channelMerchant.missingId'; }), fallbackPath: computed(() => { const no = normalizeRouteQueryValue(route.query.mchNo); @@ -53,6 +50,9 @@ const channelMerchant = ref({}); const loading = ref(false); + /** product 优先取路由(可选), 缺失时用详情反查回填 */ + const resolvedProduct = computed(() => product.value || channelMerchant.value.product || ''); + const alipayMchManageRef = ref>(); const alipayChannelMerchantManageRef = ref>(); const wechatManageRef = ref>(); @@ -147,7 +147,7 @@ return $t('payment.merchant.channelMerchant.manageTitleDefault'); } - const pageTitle = computed(() => resolvePageTitle(product.value)); + const pageTitle = computed(() => resolvePageTitle(resolvedProduct.value)); /** 银联商务产品类型展示名称(多产品共页时区分具体产品) */ const productTypeName = computed(() => { @@ -170,6 +170,10 @@ .then(({ data }) => { if (data) { channelMerchant.value = data; + // product 缺失时用详情回填 + if (!product.value && data.product) { + product.value = data.product; + } } }) .finally(() => { @@ -242,7 +246,8 @@ } mchNo.value = routeContext.query.value.mchNo; channelMerchantId.value = routeContext.query.value.id; - product.value = routeContext.query.value.product; + // product 可选(不在 keys), 缺失时由 loadChannelMerchant 回填 + product.value = normalizeRouteQueryValue(route.query.product) || ''; } watch(() => route.query, syncRouteState, { deep: true }); @@ -266,13 +271,11 @@ - + -
+
diff --git a/apps/daxpay-merchant/src/views/payment/channel-merchant/ChannelMerchantList.vue b/apps/daxpay-merchant/src/views/payment/channel-merchant/ChannelMerchantList.vue index 675ae098e..b286794cb 100644 --- a/apps/daxpay-merchant/src/views/payment/channel-merchant/ChannelMerchantList.vue +++ b/apps/daxpay-merchant/src/views/payment/channel-merchant/ChannelMerchantList.vue @@ -6,8 +6,6 @@ import { $t } from '@vben/locales'; - import { IconifyIcon } from '@vben-core/icons'; - import { ChannelMerchantApi, type ChannelMerchantResult, @@ -62,13 +60,12 @@ return source || '-'; } - /** 进入详情(仅传 id/product,不带 mchNo) */ + /** 进入详情(仅传 id, product 由 detail 页反查回填) */ function handleManage(record: ChannelMerchantResult) { router.push({ path: '/mch/channel-merchant/detail', query: { id: record.id!, - product: record.product || '', }, }); } @@ -96,11 +93,6 @@ loadList(); } - /** 创建通道商户 */ - function handleCreate() { - router.push({ path: '/mch/channel-merchant/create' }); - } - /** 切换启用状态 */ function handleToggleEnable(record: ChannelMerchantResult, checked: boolean) { const isEnabling = checked; @@ -157,14 +149,7 @@ diff --git a/apps/daxpay-merchant/src/views/payment/channel/alipay/manage/mch/app/AlipayMchAppManage.vue b/apps/daxpay-merchant/src/views/payment/channel/alipay/manage/mch/app/AlipayMchAppManage.vue new file mode 100644 index 000000000..ea593fab0 --- /dev/null +++ b/apps/daxpay-merchant/src/views/payment/channel/alipay/manage/mch/app/AlipayMchAppManage.vue @@ -0,0 +1,208 @@ + + + + + diff --git a/apps/daxpay-merchant/src/views/payment/channel/douyin/manage/DouyinDirectMchManage.vue b/apps/daxpay-merchant/src/views/payment/channel/douyin/manage/DouyinDirectMchManage.vue index 146de202f..68e748ab2 100644 --- a/apps/daxpay-merchant/src/views/payment/channel/douyin/manage/DouyinDirectMchManage.vue +++ b/apps/daxpay-merchant/src/views/payment/channel/douyin/manage/DouyinDirectMchManage.vue @@ -113,12 +113,11 @@ keyConfigRef.value?.init(); } if (card.key === 'appManage') { - const id = channelMerchant.value.id; + // 应用管理: 仅传 channelMchNo, 接收端反查名称等元数据 router.push({ path: '/mch/channel-merchant/douyin-app-manage', query: { channelMchNo: channelMchNo.value, - channelMerchantId: id, }, }); } diff --git a/apps/daxpay-merchant/src/views/payment/channel/douyin/manage/app/DouyinMchAppManage.vue b/apps/daxpay-merchant/src/views/payment/channel/douyin/manage/app/DouyinMchAppManage.vue index 0c2a8574f..eac341f22 100644 --- a/apps/daxpay-merchant/src/views/payment/channel/douyin/manage/app/DouyinMchAppManage.vue +++ b/apps/daxpay-merchant/src/views/payment/channel/douyin/manage/app/DouyinMchAppManage.vue @@ -1,17 +1,17 @@