Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
188b4033
authored
Jul 25, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能优化】PAY:微信支付使用 certSerialNo 替代 privateCertContent
parent
145226de
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
48 deletions
+9
-48
src/views/pay/app/components/channel/WeixinChannelForm.vue
+9
-48
No files found.
src/views/pay/app/components/channel/WeixinChannelForm.vue
View file @
188b4033
...
...
@@ -52,9 +52,6 @@
v-model=
"formData.config.mchKey"
placeholder=
"请输入商户密钥"
clearable
:style=
"{ width: '100%' }"
type=
"textarea"
:autosize=
"{ minRows: 8, maxRows: 8 }"
/>
</el-form-item>
<el-form-item
...
...
@@ -92,9 +89,6 @@
v-model=
"formData.config.apiV3Key"
placeholder=
"请输入 API V3 密钥"
clearable
:style=
"{ width: '100%' }"
type=
"textarea"
:autosize=
"{ minRows: 8, maxRows: 8 }"
/>
</el-form-item>
<el-form-item
...
...
@@ -126,35 +120,13 @@
</el-button>
</el-upload>
</el-form-item>
<el-form-item
label-width=
"180px"
label=
"apiclient_cert.pem证书"
prop=
"config.privateCertContent"
>
<el-form-item
label-width=
"180px"
label=
"证书序列号"
prop=
"config.certSerialNo"
>
<el-input
v-model=
"formData.config.privateCertContent"
type=
"textarea"
placeholder=
"请上传apiclient_cert.pem证书"
readonly
:autosize=
"{ minRows: 8, maxRows: 8 }"
:style=
"{ width: '100%' }"
v-model=
"formData.config.certSerialNo"
placeholder=
"请输入证书序列号"
clearable
/>
</el-form-item>
<el-form-item
label-width=
"180px"
label=
""
prop=
"privateCertContentFile"
>
<el-upload
ref=
"privateCertContentFile"
:limit=
"1"
accept=
".pem"
action=
""
:before-upload=
"pemFileBeforeUpload"
:http-request=
"privateCertContentUpload"
>
<el-button
type=
"primary"
>
<Icon
icon=
"ep:upload"
class=
"mr-5px"
/>
点击上传
</el-button>
</el-upload>
</el-form-item>
</div>
<el-form-item
label-width=
"180px"
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"formData.remark"
:style=
"{ width: '100%' }"
/>
...
...
@@ -193,7 +165,7 @@ const formData = ref<any>({
mchKey
:
''
,
keyContent
:
''
,
privateKeyContent
:
''
,
privateCertContent
:
''
,
certSerialNo
:
''
,
apiV3Key
:
''
}
})
...
...
@@ -210,8 +182,8 @@ const formRules = {
'config.privateKeyContent'
:
[
{
required
:
true
,
message
:
'请上传 apiclient_key.pem 证书'
,
trigger
:
'blur'
}
],
'config.
privateCertContent
'
:
[
{
required
:
true
,
message
:
'请
上传 apiclient_cert.pem证 书
'
,
trigger
:
'blur'
}
'config.
certSerialNo
'
:
[
{
required
:
true
,
message
:
'请
输入证书序列号
'
,
trigger
:
'blur'
}
],
'config.apiV3Key'
:
[{
required
:
true
,
message
:
'请上传 api V3 密钥值'
,
trigger
:
'blur'
}]
}
...
...
@@ -278,7 +250,7 @@ const resetForm = (appId, code) => {
mchKey
:
''
,
keyContent
:
''
,
privateKeyContent
:
''
,
privateCertContent
:
''
,
certSerialNo
:
''
,
apiV3Key
:
''
}
}
...
...
@@ -286,7 +258,7 @@ const resetForm = (appId, code) => {
}
/**
* apiclient_cert.p12、apiclient_
cert.pem、apiclient_
key.pem 上传前的校验
* apiclient_cert.p12、apiclient_key.pem 上传前的校验
*/
const
fileBeforeUpload
=
(
file
,
fileAccept
)
=>
{
let
format
=
'.'
+
file
.
name
.
split
(
'.'
)[
1
]
...
...
@@ -322,17 +294,6 @@ const privateKeyContentUpload = async (event) => {
}
/**
* 读取 apiclient_cert.pem 到 privateCertContent 字段
*/
const
privateCertContentUpload
=
async
(
event
)
=>
{
const
readFile
=
new
FileReader
()
readFile
.
onload
=
(
e
:
any
)
=>
{
formData
.
value
.
config
.
privateCertContent
=
e
.
target
.
result
}
readFile
.
readAsText
(
event
.
file
)
}
/**
* 读取 apiclient_cert.p12 到 keyContent 字段
*/
const
keyContentUpload
=
async
(
event
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment