n20-common-lib 2.9.13 → 2.9.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -33,7 +33,13 @@ const obj = {
|
|
|
33
33
|
} else {
|
|
34
34
|
msg = '请输入' + item.list[key].label
|
|
35
35
|
}
|
|
36
|
-
rules[key] = [
|
|
36
|
+
rules[key] = [
|
|
37
|
+
{
|
|
38
|
+
required: item.list[key].requiredFlag && item.list[key].type,
|
|
39
|
+
message: msg,
|
|
40
|
+
trigger: ['submit', 'change']
|
|
41
|
+
}
|
|
42
|
+
]
|
|
37
43
|
}
|
|
38
44
|
})
|
|
39
45
|
this.rules = { ...this.staticRules, ...rules }
|
|
@@ -8,6 +8,7 @@ let {
|
|
|
8
8
|
IWSASetAsyncMode, // 设置通讯方式 同步/异步
|
|
9
9
|
IWSA_rsa_csp_genContainerP10,
|
|
10
10
|
IWSA_rsa_csp_AdvgenContainerP10,
|
|
11
|
+
IWSA_rsa_csp_importSignX509Cert,
|
|
11
12
|
IWSA_rsa_csp_AdvImportSignEncCert,
|
|
12
13
|
IWSA_rsa_csp_importSignP7Cert
|
|
13
14
|
} = new IWSAgent()
|
|
@@ -47,42 +48,39 @@ function getDnCertBase64(dn, res) {
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
function getUserCert(uno) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
uno = uno || sessionStorage.getItem('userNo')
|
|
52
|
+
axios.post(`/bems/prod_1.0/dssc/sign/updateCert_direct/${uno}`).then(({ code, data }) => {
|
|
53
|
+
if (code === 200) {
|
|
54
|
+
// 设置提供者 Microsoft Base Cryptographic Provider v1.0
|
|
55
|
+
IWSA_rsa_csp_setProvider('Microsoft Base Cryptographic Provider v1.0')
|
|
56
|
+
// 设置同步模式
|
|
57
|
+
IWSASetAsyncMode(false)
|
|
58
|
+
let alg = data.alg === 'RSA_1024' ? '1024' : data.alg === 'RSA_2048' ? '2048' : '1024'
|
|
59
|
+
let dn = getDN()
|
|
60
|
+
let sd = data.sd === 'd'
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
axios.post(`/bems/prod_1.0/dssc/sign/getRadsCert`, dto).then(({ code, data }) => {
|
|
69
|
-
if (code === 200) {
|
|
70
|
-
const certData = IWSA_rsa_csp_importSignP7Cert(res[1], data.signCer)
|
|
71
|
-
if (certData[0] === '0') {
|
|
72
|
-
Message.success('证书导入成功')
|
|
73
|
-
} else {
|
|
74
|
-
Message.error('导入证书失败,错误码::' + certData[0])
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
} else {
|
|
79
|
-
Message.error('产生 P10失败,错误码::' + data[0])
|
|
62
|
+
const res = IWSA_rsa_csp_genContainerP10('true', alg, data.subjectDN || dn, '', '', '', 'false', 'false')
|
|
63
|
+
if (res[0] === '0') {
|
|
64
|
+
let dto = {
|
|
65
|
+
...data,
|
|
66
|
+
publicKey: res[2],
|
|
67
|
+
tmpPubKey: res[1] || ''
|
|
80
68
|
}
|
|
69
|
+
axios.post(`/bems/prod_1.0/dssc/sign/getRadsCert`, dto).then(({ code, data }) => {
|
|
70
|
+
if (code === 200) {
|
|
71
|
+
const certData = IWSA_rsa_csp_importSignX509Cert(res[1], data.signCer)
|
|
72
|
+
if (certData[0] === '0') {
|
|
73
|
+
Message.success('证书导入成功')
|
|
74
|
+
} else {
|
|
75
|
+
Message.error('导入证书失败,错误码::' + certData[0])
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
} else {
|
|
80
|
+
Message.error('产生 P10失败,错误码::' + data[0])
|
|
81
81
|
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
console.error(error)
|
|
85
|
-
}
|
|
82
|
+
}
|
|
83
|
+
})
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
/**
|