52
52
v-model =" formData.config.mchKey"
53
53
placeholder =" 请输入商户密钥"
54
54
clearable
55
- :style =" { width: '100%' }"
56
- type =" textarea"
57
- :autosize =" { minRows: 8, maxRows: 8 }"
58
55
/>
59
56
</el-form-item >
60
57
<el-form-item
92
89
v-model =" formData.config.apiV3Key"
93
90
placeholder =" 请输入 API V3 密钥"
94
91
clearable
95
- :style =" { width: '100%' }"
96
- type =" textarea"
97
- :autosize =" { minRows: 8, maxRows: 8 }"
98
92
/>
99
93
</el-form-item >
100
94
<el-form-item
126
120
</el-button >
127
121
</el-upload >
128
122
</el-form-item >
129
- <el-form-item
130
- label-width =" 180px"
131
- label =" apiclient_cert.pem证书"
132
- prop =" config.privateCertContent"
133
- >
123
+ <el-form-item label-width =" 180px" label =" 证书序列号" prop =" config.certSerialNo" >
134
124
<el-input
135
- v-model =" formData.config.privateCertContent"
136
- type =" textarea"
137
- placeholder =" 请上传apiclient_cert.pem证书"
138
- readonly
139
- :autosize =" { minRows: 8, maxRows: 8 }"
140
- :style =" { width: '100%' }"
125
+ v-model =" formData.config.certSerialNo"
126
+ placeholder =" 请输入证书序列号"
127
+ clearable
141
128
/>
142
129
</el-form-item >
143
- <el-form-item label-width =" 180px" label =" " prop =" privateCertContentFile" >
144
- <el-upload
145
- ref =" privateCertContentFile"
146
- :limit =" 1"
147
- accept =" .pem"
148
- action =" "
149
- :before-upload =" pemFileBeforeUpload"
150
- :http-request =" privateCertContentUpload"
151
- >
152
- <el-button type =" primary" >
153
- <Icon icon =" ep:upload" class =" mr-5px" />
154
- 点击上传
155
- </el-button >
156
- </el-upload >
157
- </el-form-item >
158
130
</div >
159
131
<el-form-item label-width =" 180px" label =" 备注" prop =" remark" >
160
132
<el-input v-model =" formData.remark" :style =" { width: '100%' }" />
@@ -193,7 +165,7 @@ const formData = ref<any>({
193
165
mchKey: ' ' ,
194
166
keyContent: ' ' ,
195
167
privateKeyContent: ' ' ,
196
- privateCertContent : ' ' ,
168
+ certSerialNo : ' ' ,
197
169
apiV3Key: ' '
198
170
}
199
171
})
@@ -210,8 +182,8 @@ const formRules = {
210
182
' config.privateKeyContent' : [
211
183
{ required: true , message: ' 请上传 apiclient_key.pem 证书' , trigger: ' blur' }
212
184
],
213
- ' config.privateCertContent ' : [
214
- { required: true , message: ' 请上传 apiclient_cert.pem证 书 ' , trigger: ' blur' }
185
+ ' config.certSerialNo ' : [
186
+ { required: true , message: ' 请输入证书序列号 ' , trigger: ' blur' }
215
187
],
216
188
' config.apiV3Key' : [{ required: true , message: ' 请上传 api V3 密钥值' , trigger: ' blur' }]
217
189
}
@@ -278,15 +250,15 @@ const resetForm = (appId, code) => {
278
250
mchKey: ' ' ,
279
251
keyContent: ' ' ,
280
252
privateKeyContent: ' ' ,
281
- privateCertContent : ' ' ,
253
+ certSerialNo : ' ' ,
282
254
apiV3Key: ' '
283
255
}
284
256
}
285
257
formRef .value ?.resetFields ()
286
258
}
287
259
288
260
/**
289
- * apiclient_cert.p12、apiclient_cert.pem、 apiclient_key.pem 上传前的校验
261
+ * apiclient_cert.p12、apiclient_key.pem 上传前的校验
290
262
*/
291
263
const fileBeforeUpload = (file , fileAccept ) => {
292
264
let format = ' .' + file .name .split (' .' )[1 ]
@@ -321,17 +293,6 @@ const privateKeyContentUpload = async (event) => {
321
293
readFile .readAsText (event .file )
322
294
}
323
295
324
- /**
325
- * 读取 apiclient_cert.pem 到 privateCertContent 字段
326
- */
327
- const privateCertContentUpload = async (event ) => {
328
- const readFile = new FileReader ()
329
- readFile .onload = (e : any ) => {
330
- formData .value .config .privateCertContent = e .target .result
331
- }
332
- readFile .readAsText (event .file )
333
- }
334
-
335
296
/**
336
297
* 读取 apiclient_cert.p12 到 keyContent 字段
337
298
*/
0 commit comments