n20-common-lib 2.9.3 → 2.9.5
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/components/DynamicField/DynamicTable.vue +1 -1
- package/src/components/Layout/HeaderWrap/indexN.vue +21 -2
- package/src/components/Layout/indexN.vue +2 -2
- package/src/directives/WorkCard/index.vue +58 -0
- package/src/plugins/Sign/NetV3/index.js +62 -1
- package/src/plugins/Sign/index.js +6 -0
package/package.json
CHANGED
|
@@ -674,7 +674,16 @@ export default {
|
|
|
674
674
|
this.changePassword()
|
|
675
675
|
break
|
|
676
676
|
case 'updateCertificate':
|
|
677
|
-
this.
|
|
677
|
+
switch (this.customOpt.updateCertType) {
|
|
678
|
+
case '1':
|
|
679
|
+
this.updateCertificate()
|
|
680
|
+
break
|
|
681
|
+
case '2':
|
|
682
|
+
this.updateCertFn()
|
|
683
|
+
break
|
|
684
|
+
default:
|
|
685
|
+
break
|
|
686
|
+
}
|
|
678
687
|
break
|
|
679
688
|
case 'changeUserInfo':
|
|
680
689
|
this.goMdmUser()
|
|
@@ -763,12 +772,22 @@ export default {
|
|
|
763
772
|
this.cpwdV = true
|
|
764
773
|
},
|
|
765
774
|
/**
|
|
766
|
-
*
|
|
775
|
+
* 京能更新证书
|
|
767
776
|
*/
|
|
768
777
|
async updateCertificate() {
|
|
769
778
|
const { updateCert } = await import('../../../plugins/Sign/index.js')
|
|
770
779
|
updateCert('ArgusKey CSP For BEHFC v1.0')
|
|
771
780
|
},
|
|
781
|
+
/**
|
|
782
|
+
* 海港更新证书
|
|
783
|
+
*/
|
|
784
|
+
async updateCertFn() {
|
|
785
|
+
const { updateCertHG } = await import('../../../plugins/Sign/index.js')
|
|
786
|
+
const { uno } = this.userInfo
|
|
787
|
+
|
|
788
|
+
updateCertHG(uno || undefined)
|
|
789
|
+
},
|
|
790
|
+
|
|
772
791
|
switchUser() {
|
|
773
792
|
this.scV = true
|
|
774
793
|
},
|
|
@@ -176,11 +176,11 @@ export default {
|
|
|
176
176
|
|
|
177
177
|
window.addEventListener('beforeunload', this.setTabList)
|
|
178
178
|
|
|
179
|
-
const { enableCertify } = await getJsonc('/server-config.jsonc')
|
|
179
|
+
const { enableCertify, enableTime } = await getJsonc('/server-config.jsonc')
|
|
180
180
|
if (enableCertify) {
|
|
181
181
|
this.certifyInterval = setInterval(() => {
|
|
182
182
|
this.getCertify()
|
|
183
|
-
}, 60000)
|
|
183
|
+
}, enableTime || 60000)
|
|
184
184
|
}
|
|
185
185
|
},
|
|
186
186
|
mounted() {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="work-card flex-column p-a m-a-0">
|
|
3
|
+
<slot name="header">
|
|
4
|
+
<div v-if="header" class="m-b flex-box">
|
|
5
|
+
<el-badge :value="badgeNum" :hidden="!badgeNum">
|
|
6
|
+
<span class="f-s-m work-card-title">{{ header }}</span>
|
|
7
|
+
</el-badge>
|
|
8
|
+
<el-link v-if="showMore" class="m-l-auto work-card-more" :underline="false" @click="$emit('more')"
|
|
9
|
+
>{{ '更多' | $lc }}<i class="el-icon-arrow-right"></i
|
|
10
|
+
></el-link>
|
|
11
|
+
</div>
|
|
12
|
+
</slot>
|
|
13
|
+
<div class="flex-item" style="height: 50%">
|
|
14
|
+
<clEmpty v-if="isEmpty" type="empty" :width="150" :height="150" style="height: 100%">
|
|
15
|
+
<span slot="content" class="work-card--empty-title">{{ '暂无数据' | $lc }}</span>
|
|
16
|
+
</clEmpty>
|
|
17
|
+
<slot v-else></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import clEmpty from '../Empty/index.vue'
|
|
24
|
+
export default {
|
|
25
|
+
name: 'WorkCard',
|
|
26
|
+
components: {
|
|
27
|
+
clEmpty
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
header: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: undefined
|
|
33
|
+
},
|
|
34
|
+
loading: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
badgeNum: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 0
|
|
41
|
+
},
|
|
42
|
+
isEmpty: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
showMore: false
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
mounted() {
|
|
53
|
+
if (this.$listeners.more) {
|
|
54
|
+
this.showMore = true
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
@@ -7,6 +7,8 @@ let {
|
|
|
7
7
|
IWSA_rsa_csp_setProvider, // 设置cspName
|
|
8
8
|
IWSASetAsyncMode, // 设置通讯方式 同步/异步
|
|
9
9
|
IWSA_rsa_csp_genContainerP10,
|
|
10
|
+
IWSA_rsa_csp_AdvgenContainerP10,
|
|
11
|
+
IWSA_rsa_csp_AdvImportSignEncCert,
|
|
10
12
|
IWSA_rsa_csp_importSignP7Cert
|
|
11
13
|
} = new IWSAgent()
|
|
12
14
|
|
|
@@ -43,8 +45,58 @@ function getDnCertBase64(dn, res) {
|
|
|
43
45
|
}
|
|
44
46
|
})
|
|
45
47
|
}
|
|
48
|
+
|
|
49
|
+
function getUserCert(uno) {
|
|
50
|
+
try {
|
|
51
|
+
axios.post(`/bems/prod_1.0/dssc/sign/updateCert_direct/${uno}`).then(({ code, data }) => {
|
|
52
|
+
if (code === 200) {
|
|
53
|
+
// 设置提供者
|
|
54
|
+
IWSA_rsa_csp_setProvider(data.certProvider)
|
|
55
|
+
// 设置同步模式
|
|
56
|
+
IWSASetAsyncMode(false)
|
|
57
|
+
let alg = data.alg === 'RSA_1024' ? '1024' : ata.alg === 'RSA_2048' ? '2048' : '1024'
|
|
58
|
+
let dn = getDN()
|
|
59
|
+
let sd = data.sd === 'd'
|
|
60
|
+
const data = IWSA_rsa_csp_AdvgenContainerP10(alg, data.subjectDN || dn, sd)
|
|
61
|
+
if (data[0] === '0') {
|
|
62
|
+
let dto = {
|
|
63
|
+
...data,
|
|
64
|
+
publicKey: data[1],
|
|
65
|
+
tmpPubKey: data[2]
|
|
66
|
+
}
|
|
67
|
+
axios.post(`/bems/prod_1.0/dssc/sign/getRadsCert`, dto).then(({ code, data }) => {
|
|
68
|
+
if (code === 200) {
|
|
69
|
+
const certData = IWSA_rsa_csp_AdvImportSignEncCert(
|
|
70
|
+
'X509',
|
|
71
|
+
data.signCer,
|
|
72
|
+
data.encCer,
|
|
73
|
+
data.encPri,
|
|
74
|
+
data.ukek
|
|
75
|
+
)
|
|
76
|
+
if (certData[0] === '0') {
|
|
77
|
+
Message.success('证书导入成功')
|
|
78
|
+
} else {
|
|
79
|
+
Message.error('导入证书失败,错误码::' + certData[0])
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
} else {
|
|
84
|
+
Message.error('产生 P10失败,错误码::' + data[0])
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
} catch (error) {
|
|
89
|
+
console.error(error)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 京能版本证书自动更新
|
|
95
|
+
* @param {*} cspName
|
|
96
|
+
* @returns
|
|
97
|
+
*/
|
|
46
98
|
export function updateCert(cspName) {
|
|
47
|
-
//
|
|
99
|
+
// 设置提供者 'ArgusKey CSP For BEHFC v1.0'
|
|
48
100
|
IWSA_rsa_csp_setProvider(cspName)
|
|
49
101
|
// 设置同步模式
|
|
50
102
|
IWSASetAsyncMode(false)
|
|
@@ -60,3 +112,12 @@ function GetDateNotAfter(res, dn) {
|
|
|
60
112
|
getDnCertBase64(dn, res)
|
|
61
113
|
}
|
|
62
114
|
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* 海港版本证书自动更新
|
|
118
|
+
* @param {*} cspName
|
|
119
|
+
* @returns
|
|
120
|
+
*/
|
|
121
|
+
export function updateCertHG(uno) {
|
|
122
|
+
getUserCert(uno)
|
|
123
|
+
}
|
|
@@ -129,3 +129,9 @@ export function updateCert(cspName) {
|
|
|
129
129
|
updateCert(cspName)
|
|
130
130
|
})
|
|
131
131
|
}
|
|
132
|
+
|
|
133
|
+
export function updateCertHG(uno) {
|
|
134
|
+
return importG('NetV3', () => import(/*webpackChunkName: "NetV3"*/ './NetV3/index.js')).then(({ updateCertHG }) => {
|
|
135
|
+
updateCertHG(uno)
|
|
136
|
+
})
|
|
137
|
+
}
|