feat 微信只保留p12证书, 支付宝中证书直接以文本方式保存

This commit is contained in:
xxm1995
2023-07-11 20:20:00 +08:00
parent 59e63aa637
commit 517ab2c168
4 changed files with 3 additions and 53 deletions

View File

@@ -180,8 +180,8 @@
showable,
formEditType,
} = useFormEdit()
// 文件上传
const { tokenHeader, uploadAction } = useUpload('/alipay/toBase64')
// 读取证书内容
const { tokenHeader, uploadAction } = useUpload('/alipay/readPem')
const { createMessage } = useMessage()
const formRef = $ref<FormInstance>()

View File

@@ -73,50 +73,6 @@
</template>
</a-input>
</a-form-item>
<a-form-item label="证书(cert.pem)" name="certPem">
<a-upload
v-if="!form.certPem"
:disabled="showable"
name="file"
:multiple="false"
:action="uploadAction"
:headers="tokenHeader"
:showUploadList="false"
@change="(info) => handleChange(info, 'certPem')"
>
<a-button type="primary" preIcon="carbon:cloud-upload"> 证书上传 </a-button>
</a-upload>
<a-input v-else defaultValue="cert.pem" disabled>
<template #addonAfter v-if="!showable">
<a-tooltip>
<template #title> 删除上传的证书文件 </template>
<icon @click="form.certPem = ''" icon="ant-design:close-circle-outlined" :size="20" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
<a-form-item label="私钥(key.pem)" name="keyPem">
<a-upload
v-if="!form.keyPem"
:disabled="showable"
name="file"
:multiple="false"
:action="uploadAction"
:headers="tokenHeader"
:showUploadList="false"
@change="(info) => handleChange(info, 'keyPem')"
>
<a-button type="primary" preIcon="carbon:cloud-upload"> 私钥上传 </a-button>
</a-upload>
<a-input v-else defaultValue="key.pem" disabled>
<template #addonAfter v-if="!showable">
<a-tooltip>
<template #title> 删除上传的证书文件 </template>
<icon @click="form.keyPem = ''" icon="ant-design:close-circle-outlined" :size="20" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
<a-form-item label="APIv2密钥" name="apiKeyV2">
<a-textarea :rows="3" :disabled="showable" v-model:value="form.apiKeyV2" placeholder="请输入APIv2密钥" />
</a-form-item>
@@ -185,8 +141,6 @@
p12: null,
apiKeyV2: '',
apiKeyV3: '',
keyPem: '',
certPem: '',
domain: '',
notifyUrl: '',
returnUrl: '',

View File

@@ -114,10 +114,6 @@ export interface WechatPayConfig extends BaseEntity {
appSecret?: string
// p12的文件id
p12?: string | null
// API 证书中的 cert.pem
certPem?: string
// API 证书中的 key.pem
keyPem?: string
// 应用域名,回调中会使用此参数
domain?: string
// 服务器异步通知页面路径

View File

@@ -85,7 +85,7 @@
// 查询条件
const fields = [
{ field: 'name', type: STRING, name: '参数名称', placeholder: '请输入字典名称' },
{ field: 'paramKey', type: STRING, name: '分组标签', placeholder: '请输入分组标签' },
{ field: 'paramKey', type: STRING, name: '参数键名', placeholder: '请输入参数键名' },
] as QueryField[]
const xTable = $ref<VxeTableInstance>()