n20-common-lib 3.3.29 → 3.3.31
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/TableProOperateColumn/OperateBtns.vue +76 -51
- package/src/components/TableProOperateColumn/OperateDisabledTip.vue +32 -0
- package/src/components/TableProOperateColumn/OperateLink.vue +21 -1
- package/src/components/TableProOperateColumn/childrenOperateBtn.vue +19 -9
- package/src/i18n.json +8 -0
- package/src/plugins/Sign/dn.js +30 -0
- package/src/plugins/Sign/sign.js +17 -18
- package/src/plugins/Sign/signV3/sign.js +35 -3
- package/src/utils/theme.config.js +2 -2
package/package.json
CHANGED
|
@@ -23,47 +23,62 @@
|
|
|
23
23
|
:command="item2.command"
|
|
24
24
|
:disabled="item2.disabled | dbdBtn(row)"
|
|
25
25
|
>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
<!-- 调用处按禁用原因选择 Tooltip;无提示时用普通 span 保留菜单内容。 -->
|
|
27
|
+
<component
|
|
28
|
+
:is="resolveDisabledTip(item2, row) ? 'OperateDisabledTip' : 'span'"
|
|
29
|
+
:content="resolveDisabledTip(item2, row)"
|
|
30
|
+
placement="left"
|
|
31
|
+
block
|
|
32
|
+
>
|
|
33
|
+
<el-badge v-if="resolveBadge(item2)" :value="resolveBadge(item2)" :max="item2.badgeMax || 99">
|
|
34
|
+
<i v-if="item2.icon" :class="item2.icon" class="m-r-ss"></i>
|
|
35
|
+
<el-link
|
|
36
|
+
v-if="item2.type"
|
|
37
|
+
:diabled="item2.disabled | dbdBtn(row)"
|
|
38
|
+
:type="item2.type"
|
|
39
|
+
:underline="false"
|
|
40
|
+
>{{ item2.label }}</el-link
|
|
41
|
+
>
|
|
42
|
+
<template v-else>{{ item2.label }}</template>
|
|
43
|
+
</el-badge>
|
|
44
|
+
<template v-else>
|
|
45
|
+
<i v-if="item2.icon" :class="item2.icon" class="m-r-ss"></i>
|
|
46
|
+
<el-link
|
|
47
|
+
v-if="item2.type"
|
|
48
|
+
:diabled="item2.disabled | dbdBtn(row)"
|
|
49
|
+
:type="item2.type"
|
|
50
|
+
:underline="false"
|
|
51
|
+
>{{ item2.label }}</el-link
|
|
52
|
+
>
|
|
53
|
+
<template v-else>{{ item2.label }}</template>
|
|
54
|
+
</template>
|
|
55
|
+
</component>
|
|
48
56
|
</el-dropdown-item>
|
|
49
57
|
</el-dropdown-menu>
|
|
50
58
|
</el-dropdown>
|
|
51
59
|
</el-dropdown-item>
|
|
52
60
|
<el-dropdown-item v-else :key="item.label" :command="item.command" :disabled="item.disabled | dbdBtn(row)">
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
<component
|
|
62
|
+
:is="resolveDisabledTip(item, row) ? 'OperateDisabledTip' : 'span'"
|
|
63
|
+
:content="resolveDisabledTip(item, row)"
|
|
64
|
+
placement="left"
|
|
65
|
+
block
|
|
66
|
+
>
|
|
67
|
+
<el-badge v-if="resolveBadge(item)" :value="resolveBadge(item)" :max="item.badgeMax || 99">
|
|
68
|
+
<i v-if="item.icon" :class="item.icon" class="m-r-ss"></i>
|
|
69
|
+
<el-link v-if="item.type" :disabled="item.disabled | dbdBtn(row)" :type="item.type" :underline="false">{{
|
|
70
|
+
item.label
|
|
71
|
+
}}</el-link>
|
|
72
|
+
<template v-else>{{ item.label }}</template>
|
|
73
|
+
</el-badge>
|
|
74
|
+
<template v-else>
|
|
75
|
+
<i v-if="item.icon" :class="item.icon" class="m-r-ss"></i>
|
|
76
|
+
<el-link v-if="item.type" :disabled="item.disabled | dbdBtn(row)" :type="item.type" :underline="false">{{
|
|
77
|
+
item.label
|
|
78
|
+
}}</el-link>
|
|
79
|
+
<template v-else>{{ item.label }}</template>
|
|
80
|
+
</template>
|
|
81
|
+
</component>
|
|
67
82
|
</el-dropdown-item>
|
|
68
83
|
</template>
|
|
69
84
|
<!-- 动态按钮加载中 -->
|
|
@@ -82,20 +97,27 @@
|
|
|
82
97
|
:command="item.command"
|
|
83
98
|
:disabled="item.disabled | dbdBtn(row)"
|
|
84
99
|
>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
<component
|
|
101
|
+
:is="resolveDisabledTip(item, row) ? 'OperateDisabledTip' : 'span'"
|
|
102
|
+
:content="resolveDisabledTip(item, row)"
|
|
103
|
+
placement="left"
|
|
104
|
+
block
|
|
105
|
+
>
|
|
106
|
+
<el-badge v-if="resolveBadge(item)" :value="resolveBadge(item)" :max="item.badgeMax || 99">
|
|
107
|
+
<i v-if="item.icon" :class="item.icon" class="m-r-ss"></i>
|
|
108
|
+
<el-link v-if="item.type" :disabled="item.disabled | dbdBtn(row)" :type="item.type" :underline="false">{{
|
|
109
|
+
item.label
|
|
110
|
+
}}</el-link>
|
|
111
|
+
<template v-else>{{ item.label }}</template>
|
|
112
|
+
</el-badge>
|
|
113
|
+
<template v-else>
|
|
114
|
+
<i v-if="item.icon" :class="item.icon" class="m-r-ss"></i>
|
|
115
|
+
<el-link v-if="item.type" :disabled="item.disabled | dbdBtn(row)" :type="item.type" :underline="false">{{
|
|
116
|
+
item.label
|
|
117
|
+
}}</el-link>
|
|
118
|
+
<template v-else>{{ item.label }}</template>
|
|
119
|
+
</template>
|
|
120
|
+
</component>
|
|
99
121
|
</el-dropdown-item>
|
|
100
122
|
</template>
|
|
101
123
|
</el-dropdown-menu>
|
|
@@ -104,11 +126,13 @@
|
|
|
104
126
|
</template>
|
|
105
127
|
<script>
|
|
106
128
|
import childrenOperateBtn from './childrenOperateBtn.vue'
|
|
129
|
+
import OperateDisabledTip, { resolveDisabledTip } from './OperateDisabledTip.vue'
|
|
107
130
|
|
|
108
131
|
export default {
|
|
109
132
|
name: 'TableOperate',
|
|
110
133
|
components: {
|
|
111
|
-
childrenOperateBtn
|
|
134
|
+
childrenOperateBtn,
|
|
135
|
+
OperateDisabledTip
|
|
112
136
|
},
|
|
113
137
|
filters: {
|
|
114
138
|
dbdBtn(dbd, row) {
|
|
@@ -167,6 +191,7 @@ export default {
|
|
|
167
191
|
}
|
|
168
192
|
},
|
|
169
193
|
methods: {
|
|
194
|
+
resolveDisabledTip,
|
|
170
195
|
resolveBadge(item) {
|
|
171
196
|
if (!item.badge) return null
|
|
172
197
|
if (typeof item.badge === 'function') {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-tooltip :content="content" :placement="placement" :tabindex="-1">
|
|
3
|
+
<!-- 禁用菜单项屏蔽了指针事件,仅恢复提示区域的 hover,点击仍然阻断。 -->
|
|
4
|
+
<span
|
|
5
|
+
:style="{ display: block ? 'block' : 'inline-flex', pointerEvents: 'auto' }"
|
|
6
|
+
@click.stop.prevent
|
|
7
|
+
>
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</span>
|
|
10
|
+
</el-tooltip>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
// 未配置新字段时直接返回,不额外执行原有 disabled 回调。
|
|
15
|
+
export function resolveDisabledTip(button, row) {
|
|
16
|
+
const value = button.disabledTip
|
|
17
|
+
if (!value || (typeof value !== 'string' && typeof value !== 'function')) return ''
|
|
18
|
+
const disabled = typeof button.disabled === 'function' ? button.disabled(row) : button.disabled === true
|
|
19
|
+
if (!disabled) return ''
|
|
20
|
+
const content = typeof value === 'function' ? value(row) : value
|
|
21
|
+
return typeof content === 'string' ? content : ''
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
name: 'OperateDisabledTip',
|
|
26
|
+
props: {
|
|
27
|
+
content: { type: String, default: '' },
|
|
28
|
+
placement: { type: String, default: 'top' },
|
|
29
|
+
block: { type: Boolean, default: false }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- 仅配置了禁用原因时启用,原有按钮继续使用下方的渲染分支。 -->
|
|
3
|
+
<operate-disabled-tip v-if="disabledTip" :content="disabledTip">
|
|
4
|
+
<el-link
|
|
5
|
+
:class="[index ? 'm-l-b' : '', { 'operate-icon-btn': item.iconOnly && item.icon }]"
|
|
6
|
+
:disabled="true"
|
|
7
|
+
:type="item.type || 'primary'"
|
|
8
|
+
:underline="false"
|
|
9
|
+
>
|
|
10
|
+
<i v-if="item.icon" :class="[item.icon, { 'm-r-ss': !item.iconOnly }]"></i>
|
|
11
|
+
<span v-if="!item.iconOnly || !item.icon">{{ item.label }}</span>
|
|
12
|
+
</el-link>
|
|
13
|
+
</operate-disabled-tip>
|
|
2
14
|
<!-- 纯图标按钮:用 tooltip 提示文字 -->
|
|
3
|
-
<el-tooltip v-if="item.iconOnly && item.icon" :content="item.tip || item.label" placement="top">
|
|
15
|
+
<el-tooltip v-else-if="item.iconOnly && item.icon" :content="item.tip || item.label" placement="top">
|
|
4
16
|
<el-link
|
|
5
17
|
:class="index ? 'm-l-b' : ''"
|
|
6
18
|
:disabled="item.disabled | dbdBtn(row)"
|
|
@@ -40,8 +52,11 @@
|
|
|
40
52
|
</template>
|
|
41
53
|
|
|
42
54
|
<script>
|
|
55
|
+
import OperateDisabledTip, { resolveDisabledTip } from './OperateDisabledTip.vue'
|
|
56
|
+
|
|
43
57
|
export default {
|
|
44
58
|
name: 'OperateLink',
|
|
59
|
+
components: { OperateDisabledTip },
|
|
45
60
|
props: {
|
|
46
61
|
item: {
|
|
47
62
|
type: Object,
|
|
@@ -56,6 +71,11 @@ export default {
|
|
|
56
71
|
default: 0
|
|
57
72
|
}
|
|
58
73
|
},
|
|
74
|
+
computed: {
|
|
75
|
+
disabledTip() {
|
|
76
|
+
return resolveDisabledTip(this.item, this.row)
|
|
77
|
+
}
|
|
78
|
+
},
|
|
59
79
|
filters: {
|
|
60
80
|
dbdBtn(dbd, row) {
|
|
61
81
|
if (dbd === undefined || dbd === null) return false
|
|
@@ -26,14 +26,22 @@
|
|
|
26
26
|
:command="childItem.command"
|
|
27
27
|
:disabled="childItem.disabled | dbdBtn(row)"
|
|
28
28
|
>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
<!-- 调用处按禁用原因选择 Tooltip;无提示时用普通 span 保留菜单内容。 -->
|
|
30
|
+
<component
|
|
31
|
+
:is="resolveDisabledTip(childItem, row) ? 'OperateDisabledTip' : 'span'"
|
|
32
|
+
:content="resolveDisabledTip(childItem, row)"
|
|
33
|
+
placement="left"
|
|
34
|
+
block
|
|
35
|
+
>
|
|
36
|
+
<el-badge v-if="resolveBadge(childItem)" :value="resolveBadge(childItem)" :max="childItem.badgeMax || 99">
|
|
37
|
+
<el-link v-if="childItem.type" :type="childItem.type" :underline="false">{{ childItem.label }}</el-link>
|
|
38
|
+
<template v-else>{{ childItem.label }}</template>
|
|
39
|
+
</el-badge>
|
|
40
|
+
<template v-else>
|
|
41
|
+
<el-link v-if="childItem.type" :type="childItem.type" :underline="false">{{ childItem.label }}</el-link>
|
|
42
|
+
<template v-else>{{ childItem.label }}</template>
|
|
43
|
+
</template>
|
|
44
|
+
</component>
|
|
37
45
|
</el-dropdown-item>
|
|
38
46
|
</template>
|
|
39
47
|
</el-dropdown-menu>
|
|
@@ -66,10 +74,11 @@
|
|
|
66
74
|
|
|
67
75
|
<script>
|
|
68
76
|
import OperateLink from './OperateLink.vue'
|
|
77
|
+
import OperateDisabledTip, { resolveDisabledTip } from './OperateDisabledTip.vue'
|
|
69
78
|
|
|
70
79
|
export default {
|
|
71
80
|
name: 'ChildrenOperateBtn',
|
|
72
|
-
components: { OperateLink },
|
|
81
|
+
components: { OperateLink, OperateDisabledTip },
|
|
73
82
|
props: {
|
|
74
83
|
btnList: {
|
|
75
84
|
type: Array,
|
|
@@ -92,6 +101,7 @@ export default {
|
|
|
92
101
|
}
|
|
93
102
|
},
|
|
94
103
|
methods: {
|
|
104
|
+
resolveDisabledTip,
|
|
95
105
|
resolveBadge(item) {
|
|
96
106
|
if (!item.badge) return null
|
|
97
107
|
if (typeof item.badge === 'function') {
|
package/src/i18n.json
CHANGED
|
@@ -6167,6 +6167,14 @@
|
|
|
6167
6167
|
"zh-hk": "憑證過期",
|
|
6168
6168
|
"es": "Certificado caducado"
|
|
6169
6169
|
},
|
|
6170
|
+
"证书已过期": {
|
|
6171
|
+
"en": "Certificate expired",
|
|
6172
|
+
"th": "ใบรับรองหมดอายุ",
|
|
6173
|
+
"vi": "Chứng chỉ đã hết hạn",
|
|
6174
|
+
"ja": "証明書の有効期限が切れました",
|
|
6175
|
+
"zh-hk": "憑證已過期",
|
|
6176
|
+
"es": "Certificado caducado"
|
|
6177
|
+
},
|
|
6170
6178
|
"证书已废止": {
|
|
6171
6179
|
"en": "Certificate has been revoked",
|
|
6172
6180
|
"th": "ใบรับรองถูกเพิกถอนแล้ว",
|
package/src/plugins/Sign/dn.js
CHANGED
|
@@ -55,3 +55,33 @@ export function isDnMatched(certDn, userDn) {
|
|
|
55
55
|
const userCn = getCn(userAttrs)
|
|
56
56
|
return certCn && userCn && certCn === userCn
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 返回匹配 DN 的证书及到期时间,保留 SDK 原始索引用于后续签名。
|
|
61
|
+
*/
|
|
62
|
+
export function getMatchedCerts(dnList, dn) {
|
|
63
|
+
return dnList
|
|
64
|
+
.map((cert, index) => ({ cert, index }))
|
|
65
|
+
.filter(({ cert }) => isDnMatched(cert.certDN, dn))
|
|
66
|
+
.map(item => ({
|
|
67
|
+
...item,
|
|
68
|
+
// NSGetCertsListInfo 的 SDK 已解码 validEnd,补齐 GMT 前的空格后解析。
|
|
69
|
+
validEndTime: new Date(item.cert.validEnd?.replace(/GMT$/, ' GMT')).getTime()
|
|
70
|
+
}))
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 业务条件筛选完成后过滤过期证书,再按到期时间倒序排列副本。
|
|
75
|
+
*/
|
|
76
|
+
export function getValidCerts(matchedCerts) {
|
|
77
|
+
const now = Date.now()
|
|
78
|
+
return matchedCerts
|
|
79
|
+
// 只剔除明确过期的证书,保留原先对缺失或无效日期的兼容行为。
|
|
80
|
+
.filter(({ validEndTime }) => !(validEndTime <= now))
|
|
81
|
+
.sort((a, b) => {
|
|
82
|
+
// 缺失或无法解析的日期放到最后,同一有效期保持原始顺序。
|
|
83
|
+
const aTime = Number.isNaN(a.validEndTime) ? -Infinity : a.validEndTime
|
|
84
|
+
const bTime = Number.isNaN(b.validEndTime) ? -Infinity : b.validEndTime
|
|
85
|
+
return bTime - aTime || a.index - b.index
|
|
86
|
+
})
|
|
87
|
+
}
|
package/src/plugins/Sign/sign.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Message, Notification } from 'element-ui'
|
|
|
3
3
|
import { $lc } from '../../utils/i18n/index.js'
|
|
4
4
|
|
|
5
5
|
import { IWSAgent } from './InfosecNetSignCNGAgent.min.js'
|
|
6
|
-
import {
|
|
6
|
+
import { getMatchedCerts, getValidCerts, isCertCheckFailed, parseCA } from './dn.js'
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
9
|
IWSASetTimeOut,
|
|
@@ -152,30 +152,29 @@ export async function performSign(plain, index) {
|
|
|
152
152
|
})
|
|
153
153
|
})
|
|
154
154
|
}
|
|
155
|
-
/**
|
|
156
|
-
* 从Dn中获取CN
|
|
157
|
-
* @param {string} dn 要解析的Dn
|
|
158
|
-
* @returns {string} 解析后的CN
|
|
159
|
-
*/
|
|
160
155
|
/**
|
|
161
156
|
* 验证Dn是否存在于Dn列表中
|
|
162
157
|
* @param {Array} dnList 获取到的Dn列表
|
|
163
158
|
* @param {string} dn 要验证的Dn
|
|
164
|
-
* @returns {number} -
|
|
159
|
+
* @returns {number} - 返回可用证书的原始索引;未匹配或全部过期时返回 -1
|
|
165
160
|
*/
|
|
166
161
|
function verifyDn(dnList, dn) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
})
|
|
174
|
-
if (index === -1) {
|
|
175
|
-
let dnList = dnList?.map((res) => res.certDN)?.join(',')
|
|
176
|
-
Message.error(`${$lc('证书Dn不匹配:')}${dnList}${$lc('里面无法匹配===>')}${dn}`)
|
|
177
|
-
return index
|
|
162
|
+
const matchedCerts = getMatchedCerts(dnList, dn)
|
|
163
|
+
if (matchedCerts.length === 0) {
|
|
164
|
+
const certDns = dnList.map((res) => res.certDN).join(',')
|
|
165
|
+
Message.error(`${$lc('证书Dn不匹配:')}${certDns}${$lc('里面无法匹配===>')}${dn}`)
|
|
166
|
+
return -1
|
|
178
167
|
}
|
|
168
|
+
|
|
169
|
+
// 保留 DN 匹配条件,剔除过期证书后选择 validEnd 最晚的一张。
|
|
170
|
+
const validCerts = getValidCerts(matchedCerts)
|
|
171
|
+
if (validCerts.length === 0) {
|
|
172
|
+
Message.error($lc('证书已过期'))
|
|
173
|
+
return -1
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// 使用原始列表索引签名,避免排序后指向其他证书。
|
|
177
|
+
const index = validCerts[0].index
|
|
179
178
|
if (index !== -1) {
|
|
180
179
|
// GMT时间字符串
|
|
181
180
|
const gmtTimeString = dnList[index].validEnd?.replace(/GMT$/, ' GMT')
|
|
@@ -3,7 +3,7 @@ import { Message, MessageBox, Notification } from 'element-ui'
|
|
|
3
3
|
import { $lc } from '../../../utils/i18n/index.js'
|
|
4
4
|
|
|
5
5
|
import { IWSAgent } from './InfosecNetSignCNGAgent.min.js'
|
|
6
|
-
import { isCertCheckFailed, isDnMatched } from '../dn.js'
|
|
6
|
+
import { getMatchedCerts, getValidCerts, isCertCheckFailed, isDnMatched } from '../dn.js'
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
9
|
IWSASetTimeOut,
|
|
@@ -153,7 +153,8 @@ export function getCertInfo(dn) {
|
|
|
153
153
|
return
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
// 仅 NSGetCertsListInfo 的证书数据执行有效期过滤及排序。
|
|
157
|
+
certInfo = verifyCertsList(dnList, dn)
|
|
157
158
|
resolve(certInfo)
|
|
158
159
|
})
|
|
159
160
|
})
|
|
@@ -239,7 +240,38 @@ async function performSignSkf(plainText, value) {
|
|
|
239
240
|
* 验证Dn是否存在于Dn列表中
|
|
240
241
|
* @param {Array} dnList 获取到的Dn列表
|
|
241
242
|
* @param {string} dn 要验证的Dn
|
|
242
|
-
* @returns {number} -
|
|
243
|
+
* @returns {number} - 返回可用证书的原始索引;未匹配或全部过期时返回 -1
|
|
244
|
+
*/
|
|
245
|
+
function verifyCertsList(dnList, dn) {
|
|
246
|
+
// 保留原有 DN、类型和用途条件,过期过滤后仍优先使用 SM2 签名证书。
|
|
247
|
+
const matchedCerts = getMatchedCerts(dnList, dn).filter(
|
|
248
|
+
({ cert }) => (cert.CertType === 'SM2' && cert.KeyUsage === 'signature') || cert.CertType === 'RSA'
|
|
249
|
+
)
|
|
250
|
+
if (matchedCerts.length === 0) {
|
|
251
|
+
let dnListB = dnList?.map((res) => res.certDN)?.join(',')
|
|
252
|
+
Message.error(`${$lc('证书Dn不匹配:')}${dnListB}${$lc('里面无法匹配===>')}${dn}`)
|
|
253
|
+
return -1
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// 所有符合条件的证书均过期时阻止后续签名。
|
|
257
|
+
const validCerts = getValidCerts(matchedCerts)
|
|
258
|
+
if (validCerts.length === 0) {
|
|
259
|
+
Message.error($lc('证书已过期'))
|
|
260
|
+
return -1
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// 列表已按到期时间倒序;优先取有效 SM2,SM2 均过期或不存在时再取 RSA。
|
|
264
|
+
const selectedCert = validCerts.find(({ cert }) => cert.CertType === 'SM2') || validCerts[0]
|
|
265
|
+
// 同步选中证书的原始索引、DN 和算法,避免排序后签名使用其他证书。
|
|
266
|
+
const { cert, index } = selectedCert
|
|
267
|
+
certIndex = index
|
|
268
|
+
certDN = cert.certDN
|
|
269
|
+
certType = cert.CertType === 'SM2' ? 'SM3' : 'SHA1'
|
|
270
|
+
return index
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* SKF 接口保留原有选证流程,其数据不参与 NSGetCertsListInfo 的有效期处理。
|
|
243
275
|
*/
|
|
244
276
|
function verifyDn(dnList, dn) {
|
|
245
277
|
let index = -1
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const themeList = [
|
|
2
2
|
{ label: '科技蓝', value: 'blue', color: '#007aff', aD: `$--color-primary: #007aff;` },
|
|
3
3
|
{
|
|
4
|
-
label: '
|
|
4
|
+
label: '海军蓝',
|
|
5
5
|
value: 'comacBlue',
|
|
6
6
|
color: '#1B7AFF',
|
|
7
|
-
//
|
|
7
|
+
// 复用组件库已有的颜色参数,仅覆盖海军蓝所需的主色、文字色、辅助色和边框色。
|
|
8
8
|
aD: `
|
|
9
9
|
$--color-primary: #1B7AFF;
|
|
10
10
|
$--color-black: #000000;
|