n20-common-lib 2.14.13 → 2.14.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "2.14.13",
3
+ "version": "2.14.15",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -26,7 +26,6 @@
26
26
  import Dialog from '../Dialog/index.vue'
27
27
  import clUpload from '../Upload/index.vue'
28
28
  import { dayjs } from 'n20-common-lib'
29
-
30
29
  export default {
31
30
  name: 'AiButton',
32
31
  components: { Dialog, clUpload },
@@ -571,12 +571,16 @@ export default {
571
571
  .then(({ opinionRequired }) => {
572
572
  this.requiredC = opinionRequired ?? this.required
573
573
  // 读取该工作流是否意见必填
574
- this.requiredC = this.$route.query.remarkIsMust === '1'
574
+ if (this.$route.query.remarkIsMust !== undefined) {
575
+ this.requiredC = this.$route.query.remarkIsMust === '1'
576
+ }
575
577
  })
576
578
  .catch(() => {
577
579
  this.requiredC = this.required
578
580
  // 读取该工作流是否意见必填
579
- this.requiredC = this.$route.query.remarkIsMust === '1'
581
+ if (this.$route.query.remarkIsMust !== undefined) {
582
+ this.requiredC = this.$route.query.remarkIsMust === '1'
583
+ }
580
584
  })
581
585
  },
582
586
  getTodoList() {
@@ -11,7 +11,7 @@
11
11
  @select="sltChange"
12
12
  @select-all="sltChange"
13
13
  >
14
- <el-table-column header-align="center" align="center" :label="'审批节点' | $lc">
14
+ <el-table-column header-align="center" align="left" :label="'审批节点' | $lc">
15
15
  <template slot-scope="scope">
16
16
  <el-radio v-model="nextEgwOutgoingNodeId" :label="scope.row.nodeId" @change="sltChange(scope.row)">{{
17
17
  scope.row.nodeName
@@ -16,7 +16,10 @@ let {
16
16
  IWSA_sm2_skf_importSignX509Cert,
17
17
  IWSA_sm2_skf_getApplicationList,
18
18
  IWSA_sm2_skf_setDevice,
19
- IWSA_sm2_skf_getDeviceList
19
+ IWSA_sm2_skf_getDeviceList,
20
+ IWSA_rsa_csp_getCountOfCert,
21
+ IWSA_rsa_csp_getCertInfo,
22
+ IWSA_rsa_csp_deleteContainer
20
23
  } = new IWSAgent()
21
24
 
22
25
  IWSASetTimeOut(6000)
@@ -132,7 +135,7 @@ function getUserCert(uno) {
132
135
  closeOnClickModal: false,
133
136
  inputType: 'password'
134
137
  }).then(({ value }) => {
135
- const res = IWSA_sm2_skf_genContainerP10(value, '', '', 'true')
138
+ const res = IWSA_sm2_skf_genContainerP10(value, '', '', 'false')
136
139
  if (res[0] === '0') {
137
140
  let dto = {
138
141
  ...data,
@@ -169,16 +172,64 @@ function getUserCert(uno) {
169
172
  * @returns
170
173
  */
171
174
  export function updateCert(cspName) {
175
+ let oldContainer = ''
172
176
  // 设置提供者 'ArgusKey CSP For BEHFC v1.0'
173
177
  IWSA_rsa_csp_setProvider(cspName)
174
178
  // 设置同步模式
175
179
  IWSASetAsyncMode(false)
176
180
  let dn = getDN()
177
181
  if (!dn) {
178
- return Message.error('未获取到Dn信息')
182
+ Message.error('未获取到Dn信息')
183
+ return
184
+ }
185
+ //获取当前证书的容器
186
+ IWSA_rsa_csp_getCountOfCert((res) => {
187
+ if (res > 0) {
188
+ for (let i = 0; i < res; i++) {
189
+ //获取证书详情
190
+ IWSA_rsa_csp_getCertInfo(i, (res, Provider, Container, certDN) => {
191
+ if (res == 0 && compareDN(certDN, dn)) {
192
+ oldContainer = Container
193
+ }
194
+ })
195
+ }
196
+ }
197
+ })
198
+ //生成新容器并下载证书
199
+ let res = IWSA_rsa_csp_genContainerP10('true', '1024', dn, '', '', '', 'false', 'false')
200
+ if (res[0] === '0') {
201
+ axios
202
+ .post(`/bems/prod_1.0/dssc/sign/getDnCertBase64`, {
203
+ userDn: dn,
204
+ p10: res[2]
205
+ })
206
+ .then(({ data }) => {
207
+ if (data) {
208
+ let list = JSON.parse(data)
209
+ if (list[0]?.errNum === '0') {
210
+ let code = IWSA_rsa_csp_importSignP7Cert(res[1], list[0]?.cert)
211
+ if (code === '0') {
212
+ //删除旧证书
213
+ if (oldContainer != '') {
214
+ IWSA_rsa_csp_deleteContainer(oldContainer)
215
+ }
216
+ Message.success('证书导入成功')
217
+ } else {
218
+ IWSA_rsa_csp_deleteContainer(res[1])
219
+ Message.error('证书导入失败,错误码::' + code)
220
+ }
221
+ } else {
222
+ IWSA_rsa_csp_deleteContainer(res[1])
223
+ Message.error('证书下载失败,错误码::' + list[0]?.errNum)
224
+ }
225
+ } else {
226
+ IWSA_rsa_csp_deleteContainer(res[1])
227
+ Message.error('证书下载服务出错')
228
+ }
229
+ })
230
+ } else {
231
+ Message.error('容器生成失败,错误码::' + res[0])
179
232
  }
180
- let data = IWSA_rsa_csp_genContainerP10('true', '1024', dn, '', '', '', 'false', 'false')
181
- GetDateNotAfter(data, dn)
182
233
  }
183
234
  function GetDateNotAfter(res, dn) {
184
235
  if (res[0] === '0') {
@@ -194,3 +245,12 @@ function GetDateNotAfter(res, dn) {
194
245
  export function updateCertHG(uno) {
195
246
  getUserCert(uno)
196
247
  }
248
+
249
+ function compareDN(dn1, dn2) {
250
+ let dn1Arr = dn1.split(',').map((c) => c.trim())
251
+ let dn2Arr = dn2.split(',').map((c) => c.trim())
252
+ if (dn1Arr.every((dnAttr) => dn2Arr.includes(dnAttr))) {
253
+ return true
254
+ }
255
+ return false
256
+ }