n20-common-lib 2.10.20 → 2.10.21
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 +1 -1
- package/src/plugins/Sign/index.js +36 -34
package/package.json
CHANGED
|
@@ -34,11 +34,8 @@ async function disposeSign(config, p1, p2, p3) {
|
|
|
34
34
|
config = CaMap['SkfSign']
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const path =
|
|
38
|
-
|
|
39
|
-
const module = await importG(config.type, () =>
|
|
40
|
-
import(`${path}`)
|
|
41
|
-
)
|
|
37
|
+
const path = typeof config.path === 'function' ? config.path(p3) : config.path
|
|
38
|
+
const module = await importG(config.type, () => import(`${path}`))
|
|
42
39
|
|
|
43
40
|
if (config.needAvailable) {
|
|
44
41
|
await new Promise((resolve, reject) => {
|
|
@@ -89,29 +86,38 @@ export async function getSign(p1, p2, p3) {
|
|
|
89
86
|
* @param {string} dn - 证书DN
|
|
90
87
|
* @returns {Promise<*>} 证书信息
|
|
91
88
|
*/
|
|
92
|
-
export
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
import(/*webpackChunkName: "
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
89
|
+
export function getCert(dn) {
|
|
90
|
+
let signType = window.sessionStorage.getItem('signType')
|
|
91
|
+
return new Promise((resolve, reject) => {
|
|
92
|
+
if (signType === 'inetSign' /* 信安CA */) {
|
|
93
|
+
importG('inetSign', () => import(/*webpackChunkName: "inetSign"*/ './sign.js')).then(({ getCertInfo }) => {
|
|
94
|
+
getCertInfo(dn).then((res) => {
|
|
95
|
+
resolve(res)
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
} else if (signType === 'SkfSign') {
|
|
99
|
+
importG('SkfSign', () => import(/*webpackChunkName: "SkfSign"*/ './SkfSign/index.js')).then(({ getCertInfo }) => {
|
|
100
|
+
getCertInfo(dn).then((res) => {
|
|
101
|
+
resolve(res)
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
} else if (signType === 'NetSM3') {
|
|
105
|
+
importG('NetSM3', () => import(/*webpackChunkName: "NetSM3"*/ './NetSM3/index.js')).then(({ getCertInfo }) => {
|
|
106
|
+
getCertInfo(dn).then((res) => {
|
|
107
|
+
resolve(res)
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
} else if (signType === 'ItrusSign') {
|
|
111
|
+
importG('ItrusSign', () => import(/*webpackChunkName: "ItrusSign"*/ './Itrus/index.js')).then(({ getCert }) => {
|
|
112
|
+
try {
|
|
113
|
+
const itrusGetCert = getCert(dn)
|
|
114
|
+
resolve(itrusGetCert)
|
|
115
|
+
} catch (error) {
|
|
116
|
+
reject()
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
})
|
|
115
121
|
}
|
|
116
122
|
|
|
117
123
|
/**
|
|
@@ -120,9 +126,7 @@ export async function getCert(dn) {
|
|
|
120
126
|
* @returns {Promise<void>}
|
|
121
127
|
*/
|
|
122
128
|
export async function updateCert(cspName) {
|
|
123
|
-
const { updateCert } = await importG('NetV3', () =>
|
|
124
|
-
import(/*webpackChunkName: "NetV3"*/ './NetV3/index.js')
|
|
125
|
-
)
|
|
129
|
+
const { updateCert } = await importG('NetV3', () => import(/*webpackChunkName: "NetV3"*/ './NetV3/index.js'))
|
|
126
130
|
await updateCert(cspName)
|
|
127
131
|
}
|
|
128
132
|
|
|
@@ -132,8 +136,6 @@ export async function updateCert(cspName) {
|
|
|
132
136
|
* @returns {Promise<void>}
|
|
133
137
|
*/
|
|
134
138
|
export async function updateCertHG(uno) {
|
|
135
|
-
const { updateCertHG } = await importG('NetV3', () =>
|
|
136
|
-
import(/*webpackChunkName: "NetV3"*/ './NetV3/index.js')
|
|
137
|
-
)
|
|
139
|
+
const { updateCertHG } = await importG('NetV3', () => import(/*webpackChunkName: "NetV3"*/ './NetV3/index.js'))
|
|
138
140
|
await updateCertHG(uno)
|
|
139
141
|
}
|