n20-common-lib 2.1.19 → 2.1.20

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.1.19",
3
+ "version": "2.1.20",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -144,6 +144,7 @@ import axios from '../../utils/axios'
144
144
  import auth from '../../utils/auth'
145
145
  import qrCode from './qrcode.vue'
146
146
  import { siteTree2menus, siteTree2RelaNos } from './utils'
147
+ import CaMap from '../../plugins/Sign/CaMap.js'
147
148
  import importG from '../../utils/importGlobal.js'
148
149
 
149
150
  function encode(pwd = '', key = 0) {
@@ -403,25 +404,8 @@ export default {
403
404
  let sign = undefined
404
405
  let certDn = undefined
405
406
  if (supplier) {
406
- if (supplier === 'bjca') {
407
- // 北京CA
408
- window.sessionStorage.setItem('signType', 'bjcaSign')
409
- } else if (supplier === 'Itrus') {
410
- // 天威CA
411
- window.sessionStorage.setItem('signType', 'ItrusSign')
412
- } else if (supplier === 'NetServerSkf') {
413
- // 信安国密
414
- window.sessionStorage.setItem('signType', 'SkfSign')
415
- } else if (supplier === 'netca') {
416
- // 网证通
417
- window.sessionStorage.setItem('signType', 'netcaSign')
418
- } else if (supplier === 'NetSM3') {
419
- // 网证通
420
- window.sessionStorage.setItem('signType', 'NetSM3')
421
- } else {
422
- // 信安CA
423
- window.sessionStorage.setItem('signType', 'inetSign')
424
- }
407
+ let CaItem = Object.values(CaMap).find((item) => item.supplier === supplier) || CaMap['null']
408
+ window.sessionStorage.setItem('signType', CaItem.type)
425
409
  }
426
410
  if (checkCert) {
427
411
  this.loadingAdd()
@@ -0,0 +1,37 @@
1
+ // Key与type值要相同
2
+ export default {
3
+ null: {
4
+ name: '信安CA',
5
+ type: 'inetSign'
6
+ },
7
+ inetSign: {
8
+ name: '信安CA',
9
+ type: 'inetSign',
10
+ supplier: 'inetSign'
11
+ },
12
+ bjcaSign: {
13
+ name: '北京CA',
14
+ type: 'bjcaSign',
15
+ supplier: 'bjca'
16
+ },
17
+ ItrusSign: {
18
+ name: '天威CA',
19
+ type: 'ItrusSign',
20
+ supplier: 'Itrus'
21
+ },
22
+ SkfSign: {
23
+ name: '信安国密',
24
+ type: 'SkfSign',
25
+ supplier: 'NetServerSkf'
26
+ },
27
+ netcaSign: {
28
+ name: '网证通',
29
+ type: 'netcaSign',
30
+ supplier: 'netca'
31
+ },
32
+ NetSM3: {
33
+ name: '信安国密软签',
34
+ type: 'NetSM3',
35
+ supplier: 'NetSM3'
36
+ }
37
+ }
@@ -1,18 +1,11 @@
1
1
  import importG from '../../utils/importGlobal.js'
2
2
 
3
+ import CaMap from './CaMap.js'
3
4
  export async function getSign(p1, p2, p3) {
4
5
  let signType = window.sessionStorage.getItem('signType')
5
- let CaMap = {
6
- inetSign: '信安CA',
7
- SkfSign: '信安国密',
8
- bjcaSign: '北京CA',
9
- ItrusSign: '天威CA',
10
- netcaSign: '网证通',
11
- NetSM3: '信安国密软签'
12
- }
13
6
  if (!signType || !CaMap[signType]) {
14
7
  console.error('请设置签名服务公司sessionStorage.signType,公司字段映射:', CaMap)
15
- signType = 'inetSign'
8
+ signType = CaMap['null'] ? CaMap['null'].type : ''
16
9
  }
17
10
 
18
11
  const por = new Promise((resolve, reject) => {