Skip to content

Commit a9e52b4

Browse files
YunaiVgitee-org
authored andcommitted
!498 【功能优化】支持支付宝接口内容加密,及修复支付宝渠道配置前端校验失效问题
Merge pull request !498 from zhaoyu/master
2 parents 254d1e0 + 6afcfdd commit a9e52b4

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

src/views/pay/app/components/channel/AlipayChannelForm.vue

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<el-form
55
ref="formRef"
66
:model="formData"
7-
:formRules="formRules"
7+
:rules="formRules"
88
label-width="100px"
99
v-loading="formLoading"
1010
>
@@ -156,6 +156,20 @@
156156
</el-upload>
157157
</el-form-item>
158158
</div>
159+
160+
<el-form-item label-width="180px" label="接口内容加密方式" prop="config.encryptType">
161+
<el-radio-group v-model="formData.config.encryptType">
162+
<el-radio key="AES" label="AES">AES</el-radio>
163+
<el-radio key="NONE" label="">无加密</el-radio>
164+
</el-radio-group>
165+
</el-form-item>
166+
167+
<div v-if="formData.config.encryptType === 'AES'">
168+
<el-form-item label-width="180px" label="AES 密钥" prop="config.encryptKey">
169+
<el-input v-model="formData.config.encryptKey" placeholder="请输入接口内容加密密钥" clearable />
170+
</el-form-item>
171+
</div>
172+
159173
<el-form-item label-width="180px" label="备注" prop="remark">
160174
<el-input v-model="formData.remark" :style="{ width: '100%' }" />
161175
</el-form-item>
@@ -195,7 +209,9 @@ const formData = ref<any>({
195209
alipayPublicKey: '',
196210
appCertContent: '',
197211
alipayPublicCertContent: '',
198-
rootCertContent: ''
212+
rootCertContent: '',
213+
encryptType: '',
214+
encryptKey: '',
199215
}
200216
})
201217
const formRules = {
@@ -213,7 +229,8 @@ const formRules = {
213229
'config.alipayPublicCertContent': [
214230
{ required: true, message: '请上传支付宝公钥证书', trigger: 'blur' }
215231
],
216-
'config.rootCertContent': [{ required: true, message: '请上传指定根证书', trigger: 'blur' }]
232+
'config.rootCertContent': [{ required: true, message: '请上传指定根证书', trigger: 'blur' }],
233+
'config.encryptKey': [{required: true, message: '请输入接口内容加密密钥', trigger: 'blur'}],
217234
}
218235
const fileAccept = '.crt'
219236
const formRef = ref() // 表单 Ref
@@ -281,7 +298,9 @@ const resetForm = (appId, code) => {
281298
alipayPublicKey: '',
282299
appCertContent: '',
283300
alipayPublicCertContent: '',
284-
rootCertContent: ''
301+
rootCertContent: '',
302+
encryptType: 'AES',
303+
encryptKey: '',
285304
}
286305
}
287306
formRef.value?.resetFields()

0 commit comments

Comments
 (0)