From 104d65443b73b2c3d82d65849df763211a936b3a Mon Sep 17 00:00:00 2001 From: DaxPay Dev Date: Thu, 9 Jul 2026 19:59:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(wechat):=20=E7=AE=A1=E7=90=86=E7=AB=AF?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=95=86?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=BA=94=E7=94=A8=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在特约商户应用管理中新增认证应用配置弹窗,创建与基本信息同步暴露 authAppType。 Co-authored-by: Cursor --- .../channel/wechat/channel-merchant.api.ts | 20 ++++ .../en-US/payment/channel/wechatManage.json | 10 ++ .../zh-CN/payment/channel/wechatManage.json | 10 ++ .../wechat/config/WechatMchCreateConfig.vue | 22 ++++ .../mch/WechatChannelMerchantBasicInfo.vue | 14 +++ .../mch/WechatChannelMerchantManage.vue | 15 +++ .../manage/mch/WechatIsvAuthAppConfig.vue | 112 ++++++++++++++++++ 7 files changed, 203 insertions(+) create mode 100644 apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatIsvAuthAppConfig.vue diff --git a/apps/daxpay-admin/src/api/payment/channel/wechat/channel-merchant.api.ts b/apps/daxpay-admin/src/api/payment/channel/wechat/channel-merchant.api.ts index e1025b796..42c48158f 100644 --- a/apps/daxpay-admin/src/api/payment/channel/wechat/channel-merchant.api.ts +++ b/apps/daxpay-admin/src/api/payment/channel/wechat/channel-merchant.api.ts @@ -21,6 +21,12 @@ export const WechatIsvChannelMerchantApi = { params: { channelMchNo }, }); }, + /** + * 更新认证应用类型 + */ + updateAuthAppType(data: WechatIsvAuthAppTypeUpdateParam): Promise> { + return defHttp.post({ url: '/admin/wechat/isv-channel-merchant/update-auth-app-type', data }); + }, }; /** @@ -69,6 +75,8 @@ export interface WechatIsvChannelMerchantConfig extends MchEntity { product?: string; /** 微信特约商户号/二级商户号 */ subMchId?: string; + /** 认证应用类型: SP_APP=服务商应用, SUB_APP=子商户应用 */ + authAppType?: string; } /** @@ -95,6 +103,18 @@ export interface WechatIsvChannelMerchantCreateParam { product: string; /** 微信特约商户号/二级商户号 */ subMchId: string; + /** 认证应用类型: SP_APP=服务商应用, SUB_APP=子商户应用, 默认 SP_APP */ + authAppType?: string; +} + +/** + * 微信服务商认证应用类型更新参数 + */ +export interface WechatIsvAuthAppTypeUpdateParam { + /** 通道商户号 */ + channelMchNo: string; + /** 认证应用类型: SP_APP=服务商应用, SUB_APP=子商户应用 */ + authAppType: string; } /** diff --git a/apps/daxpay-admin/src/locales/langs/en-US/payment/channel/wechatManage.json b/apps/daxpay-admin/src/locales/langs/en-US/payment/channel/wechatManage.json index 4ce004f5c..be9f5260c 100644 --- a/apps/daxpay-admin/src/locales/langs/en-US/payment/channel/wechatManage.json +++ b/apps/daxpay-admin/src/locales/langs/en-US/payment/channel/wechatManage.json @@ -57,6 +57,16 @@ "capabilityIspDefault": "ISP Default", "capabilityIspNotConfigured": "Not configured", "capabilityNoMchAppTip": "No sub-merchant app created; all capabilities will use the ISP default app", + "cardAuthApp": "Auth App Config", + "cardAuthAppDesc": "Choose whether OpenId authorization uses the service provider app or the sub-merchant app", + "authAppConfigTitle": "Auth App Config", + "authAppType": "Auth Application Type", + "authAppTypeSpApp": "Service Provider App", + "authAppTypeSubApp": "Sub-merchant App", + "authAppTypeRequired": "Please select auth application type", + "authAppTypeSubTip": "When using a sub-merchant app, create one in App Management and configure auth settings first", + "authAppTypeConfirm": "Confirm changing the auth application type?", + "authAppTypeSaveSuccess": "Auth application type saved successfully", "validation": { "appSecret": "App secret is required", "authCallbackUrl": "Auth callback URL is required" diff --git a/apps/daxpay-admin/src/locales/langs/zh-CN/payment/channel/wechatManage.json b/apps/daxpay-admin/src/locales/langs/zh-CN/payment/channel/wechatManage.json index cce4d596e..96620ab95 100644 --- a/apps/daxpay-admin/src/locales/langs/zh-CN/payment/channel/wechatManage.json +++ b/apps/daxpay-admin/src/locales/langs/zh-CN/payment/channel/wechatManage.json @@ -57,6 +57,16 @@ "capabilityIspDefault": "服务商默认", "capabilityIspNotConfigured": "未配置", "capabilityNoMchAppTip": "尚未创建子商户应用,所有能力将使用服务商默认应用", + "cardAuthApp": "认证应用配置", + "cardAuthAppDesc": "选择 OpenId 授权使用服务商应用还是子商户应用", + "authAppConfigTitle": "认证应用配置", + "authAppType": "认证应用类型", + "authAppTypeSpApp": "服务商应用", + "authAppTypeSubApp": "子商户应用", + "authAppTypeRequired": "请选择认证应用类型", + "authAppTypeSubTip": "选择子商户应用时,请先在应用管理中创建并配置授权认证参数", + "authAppTypeConfirm": "确认修改认证应用类型?", + "authAppTypeSaveSuccess": "认证应用类型保存成功", "validation": { "appSecret": "请输入应用密钥", "authCallbackUrl": "请输入授权回调地址" diff --git a/apps/daxpay-admin/src/views/payment/channel/wechat/config/WechatMchCreateConfig.vue b/apps/daxpay-admin/src/views/payment/channel/wechat/config/WechatMchCreateConfig.vue index c9389e466..b0e7d7311 100644 --- a/apps/daxpay-admin/src/views/payment/channel/wechat/config/WechatMchCreateConfig.vue +++ b/apps/daxpay-admin/src/views/payment/channel/wechat/config/WechatMchCreateConfig.vue @@ -29,6 +29,8 @@ const formRef = ref(); const form = ref({ channelMerchantName: '', subMchId: '', + // 认证应用类型, 默认服务商应用 + authAppType: 'SP_APP', }); const visible = ref(false); @@ -49,6 +51,7 @@ const productDisplayName = computed(() => { const rules = computed(() => ({ channelMerchantName: [{ required: true, message: $t('payment.merchant.channelMerchant.channelMerchantNameRequired') }], subMchId: [{ required: true, message: $t('payment.merchant.channelMerchant.wechatSubMerchantNoRequired') }], + authAppType: [{ required: true, message: $t('payment.channel.wechatManage.authAppTypeRequired') }], })); function init(no: string, product: string, channel: string) { @@ -86,6 +89,7 @@ function resetForm() { form.value = { channelMerchantName: '', subMchId: '', + authAppType: 'SP_APP', }; nextTick(() => { formRef.value?.resetFields(); @@ -128,6 +132,24 @@ defineExpose({ init }); :placeholder="$t('payment.merchant.channelMerchant.wechatSubMerchantNoPlaceholder')" /> + + + + + {{ $t('payment.channel.wechatManage.authAppTypeSpApp') }} + + + {{ $t('payment.channel.wechatManage.authAppTypeSubApp') }} + + + + + +
diff --git a/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatChannelMerchantBasicInfo.vue b/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatChannelMerchantBasicInfo.vue index 44003fabc..da32f2cc2 100644 --- a/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatChannelMerchantBasicInfo.vue +++ b/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatChannelMerchantBasicInfo.vue @@ -34,6 +34,17 @@ const sourceLabel = computed(() => { return props.channelMerchant.source || '-'; }); +/** 认证应用类型展示文案 */ +const authAppTypeLabel = computed(() => { + if (config.value.authAppType === 'SUB_APP') { + return $t('payment.channel.wechatManage.authAppTypeSubApp'); + } + if (config.value.authAppType === 'SP_APP' || !config.value.authAppType) { + return $t('payment.channel.wechatManage.authAppTypeSpApp'); + } + return config.value.authAppType; +}); + /** 加载微信服务商通道商户配置 */ function loadConfig() { if (!props.channelMchNo) { @@ -96,6 +107,9 @@ defineExpose({ open, close }); {{ config.subMchId || '-' }} + + {{ authAppTypeLabel }} + diff --git a/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatChannelMerchantManage.vue b/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatChannelMerchantManage.vue index a3e8720ff..8a4715570 100644 --- a/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatChannelMerchantManage.vue +++ b/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatChannelMerchantManage.vue @@ -13,6 +13,7 @@ import ChannelMerchantNameEditModal from '#/views/payment/merchant/channel-merchant/detail/ChannelMerchantNameEditModal.vue'; import WechatChannelMerchantBasicInfo from './WechatChannelMerchantBasicInfo.vue'; + import WechatIsvAuthAppConfig from './WechatIsvAuthAppConfig.vue'; import WechatIsvMchAppCapability from './WechatIsvMchAppCapability.vue'; defineOptions({ name: 'WechatChannelMerchantManage' }); @@ -29,6 +30,7 @@ const channelMerchant = ref({}); const basicInfoRef = ref>(); const capabilityRef = ref>(); + const authAppConfigRef = ref>(); const editNameRef = ref>(); /** 功能卡片配置 */ @@ -73,6 +75,13 @@ icon: 'ant-design:api-outlined', description: $t('payment.channel.wechatManage.cardCapabilityBindingDesc'), }, + { + key: 'authApp', + // 国际化:认证应用配置 + title: $t('payment.channel.wechatManage.cardAuthApp'), + icon: 'ant-design:safety-certificate-outlined', + description: $t('payment.channel.wechatManage.cardAuthAppDesc'), + }, ], }, ]); @@ -125,6 +134,10 @@ capabilityRef.value?.show(mchNo.value, channelMchNo.value); return; } + if (card.key === 'authApp') { + authAppConfigRef.value?.open(channelMchNo.value); + return; + } message.info($t('payment.merchant.channelMerchant.developing')); } @@ -182,6 +195,8 @@ + +
diff --git a/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatIsvAuthAppConfig.vue b/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatIsvAuthAppConfig.vue new file mode 100644 index 000000000..c5f16c3cf --- /dev/null +++ b/apps/daxpay-admin/src/views/payment/channel/wechat/manage/mch/WechatIsvAuthAppConfig.vue @@ -0,0 +1,112 @@ + + +