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) +}