n20-common-lib 2.15.1 → 2.15.3
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
|
@@ -147,7 +147,7 @@ export default {
|
|
|
147
147
|
)
|
|
148
148
|
this.reason = data1?.suggestion || ''
|
|
149
149
|
this.reasonSelect = data1?.suggestion || ''
|
|
150
|
-
if (data1.flowHistoryCfgs && data1.flowHistoryCfgs.length > 0) {
|
|
150
|
+
if (data1 && data1.flowHistoryCfgs && data1.flowHistoryCfgs.length > 0) {
|
|
151
151
|
this.otherAttDataA = this.otherAttDataA.map((item) => {
|
|
152
152
|
const bcData = data1.flowHistoryCfgs.find((item2) => {
|
|
153
153
|
return item2.cfgKey === item.cfgKey
|
|
@@ -83,5 +83,10 @@ function toUnsignBytes(bytes) {
|
|
|
83
83
|
}
|
|
84
84
|
return bs
|
|
85
85
|
}
|
|
86
|
+
function stringToRawHex(str) {
|
|
87
|
+
return Array.from(str)
|
|
88
|
+
.map((char) => char.charCodeAt(0).toString(16).padStart(2, '0').toUpperCase())
|
|
89
|
+
.join('')
|
|
90
|
+
}
|
|
86
91
|
|
|
87
|
-
export { encode, decode, toUnsignBytes }
|
|
92
|
+
export { encode, decode, toUnsignBytes, stringToRawHex }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Message, MessageBox, Notification } from 'element-ui'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { hexToBase64 } from './base64'
|
|
3
|
+
import { stringToRawHex } from './hex'
|
|
4
4
|
import SKF from './skf'
|
|
5
5
|
|
|
6
6
|
/*
|
|
@@ -69,10 +69,9 @@ export async function getSign(plain, dn = getDN()) {
|
|
|
69
69
|
Message.error('签名参数DN错误!')
|
|
70
70
|
return false
|
|
71
71
|
}
|
|
72
|
-
|
|
73
72
|
// 处理签名文本
|
|
74
|
-
const plainText =
|
|
75
|
-
|
|
73
|
+
const plainText =
|
|
74
|
+
typeof plain === 'object' ? hexToBase64(stringToRawHex(JSON.stringify(plain))) : hexToBase64(stringToRawHex(plain))
|
|
76
75
|
// 获取并验证证书信息
|
|
77
76
|
const checkRes = await getCertInfo(dn)
|
|
78
77
|
console.log('checkRes', checkRes)
|
|
@@ -152,8 +151,9 @@ export async function getCertInfo(dn) {
|
|
|
152
151
|
// 检测dn是否匹配
|
|
153
152
|
if (indexDn === -1) {
|
|
154
153
|
console.log(DNList)
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
resolve(-1)
|
|
155
|
+
Message.error('当前Ukey不匹配!')
|
|
156
|
+
// resolve({ Container, Application })
|
|
157
157
|
} else {
|
|
158
158
|
resolve({ Container, Application })
|
|
159
159
|
}
|