From 45e3667b38c23dcf034b63154592ea1b76b69f62 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 5 May 2025 23:03:35 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Aweixin-java=20from=204.7.2.B=20=3D?= =?UTF-8?q?>=204.7.4.B=20feat=EF=BC=9A=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98?= =?UTF-8?q?=20v3=20=E4=BB=8E=E5=B9=B3=E5=8F=B0=E8=AF=81=E4=B9=A6=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E6=88=90=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98=E5=85=AC?= =?UTF-8?q?=E9=92=A5=20feat=EF=BC=9A=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98?= =?UTF-8?q?=20v3=20=E5=A2=9E=E5=8A=A0=20header=20=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/channel/WeixinChannelForm.vue | 68 +++++++++++++++++-- 1 file changed, 64 insertions(+), 4 deletions(-) diff --git a/src/views/pay/app/components/channel/WeixinChannelForm.vue b/src/views/pay/app/components/channel/WeixinChannelForm.vue index 0b4a1d38..daebb41e 100644 --- a/src/views/pay/app/components/channel/WeixinChannelForm.vue +++ b/src/views/pay/app/components/channel/WeixinChannelForm.vue @@ -71,11 +71,12 @@ > @@ -108,11 +109,12 @@ > @@ -145,6 +147,47 @@ 前往微信商户平台查看证书序列号 + + + + + + + + 点击上传 + + + + + + + + + 微信支付公钥产品简介及使用说明 + + @@ -184,7 +227,9 @@ const formData = ref({ keyContent: '', privateKeyContent: '', certSerialNo: '', - apiV3Key: '' + apiV3Key: '', + publicKeyContent: '', + publicKeyId: '' } }) const formRules = { @@ -201,6 +246,8 @@ const formRules = { { required: true, message: '请上传 apiclient_key.pem 证书', trigger: 'blur' } ], 'config.certSerialNo': [{ required: true, message: '请输入证书序列号', trigger: 'blur' }], + 'config.publicKeyContent': [{ required: true, message: '请上传 public_key.pem 证书', trigger: 'blur' }], + 'config.publicKeyId': [{ required: true, message: '请输入公钥 ID', trigger: 'blur' }], 'config.apiV3Key': [{ required: true, message: '请上传 api V3 密钥值', trigger: 'blur' }] } const formRef = ref() // 表单 Ref @@ -267,7 +314,9 @@ const resetForm = (appId, code) => { keyContent: '', privateKeyContent: '', certSerialNo: '', - apiV3Key: '' + apiV3Key: '', + publicKeyContent: '', + publicKeyId: '' } } formRef.value?.resetFields() @@ -318,4 +367,15 @@ const keyContentUpload = async (event) => { } readFile.readAsDataURL(event.file) // 读成 base64 } + +/** + * 读取 public_key.pem 到 publicKeyContent 字段 + */ +const publicKeyContentUpload = async (event) => { + const readFile = new FileReader() + readFile.onload = (e: any) => { + formData.value.config.publicKeyContent = e.target.result + } + readFile.readAsText(event.file) +}