n20-common-lib 2.9.55 → 2.9.56
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
|
Binary file
|
|
@@ -150,14 +150,15 @@
|
|
|
150
150
|
<el-button type="primary" @click="approvalToV = true">{{ '批准至' | $lc }}</el-button>
|
|
151
151
|
<el-button plain @click="rejectToB">{{ '驳回至' | $lc }}</el-button>
|
|
152
152
|
<el-button plain @click="rejectFn">{{ '驳回至发起人' | $lc }}</el-button>
|
|
153
|
-
<!-- <el-button v-if="authList.includes('rejectPre')" plain @click="rejectPreFn">{{
|
|
154
|
-
'驳回至上一节点' | $lc
|
|
155
|
-
}}</el-button> -->
|
|
156
|
-
|
|
157
153
|
<el-button type="danger" plain @click="discardFn">{{ '作 废' | $lc }}</el-button>
|
|
158
154
|
<el-button plain @click="goFrom">{{ '返 回' | $lc }}</el-button>
|
|
159
155
|
</div>
|
|
156
|
+
|
|
160
157
|
<div v-else-if="!authList.includes('byAddTask')" class="text-c">
|
|
158
|
+
<!-- 特殊会签按钮 START -->
|
|
159
|
+
<el-button v-if="authList.includes('pass')" type="primary" @click="checkFlowFn">{{ '通 过' | $lc }}</el-button>
|
|
160
|
+
<el-button v-if="authList.includes('refuse')" type="primary" @click="rejectFn">{{ '拒 绝' | $lc }}</el-button>
|
|
161
|
+
<!-- END -->
|
|
161
162
|
<el-button v-if="authList.includes('approval')" type="primary" @click="checkFlowFn">{{
|
|
162
163
|
'批 准' | $lc
|
|
163
164
|
}}</el-button>
|
|
@@ -101,6 +101,16 @@ export async function getSign(p1, p2, p3) {
|
|
|
101
101
|
reject()
|
|
102
102
|
})
|
|
103
103
|
})
|
|
104
|
+
} else if (signType === 'sdcaSign' /* SDCA */) {
|
|
105
|
+
importG('CFCA', () => import(/*webpackChunkName: "SDCA"*/ './sdca/index.js')).then(({ getSign }) => {
|
|
106
|
+
getSign(p1, p2, p3)
|
|
107
|
+
.then((sign) => {
|
|
108
|
+
resolve(sign)
|
|
109
|
+
})
|
|
110
|
+
.catch(() => {
|
|
111
|
+
reject()
|
|
112
|
+
})
|
|
113
|
+
})
|
|
104
114
|
}
|
|
105
115
|
})
|
|
106
116
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 山地CA
|
|
3
|
+
* by 2025-1-2
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import axios from 'axios'
|
|
7
|
+
import { Message } from 'element-ui'
|
|
8
|
+
|
|
9
|
+
async function getKeyExist() {
|
|
10
|
+
const { data } = await axios.get('http://127.0.0.1:8090/keyExist')
|
|
11
|
+
if (data.code !== 200) {
|
|
12
|
+
Message.warning('Ukey不存在!')
|
|
13
|
+
throw new Error('Ukey不存在!')
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function getCertSN() {
|
|
18
|
+
const { data } = await axios.get('http://127.0.0.1:8090/getCertSN')
|
|
19
|
+
if (data.code !== 200) {
|
|
20
|
+
Message.warning('获取证书序列号失败!')
|
|
21
|
+
throw new Error('获取证书序列号失败!')
|
|
22
|
+
}
|
|
23
|
+
return data.msg
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function performSign(plain) {
|
|
27
|
+
const { data } = await axios.get(`http://127.0.0.1:8090/sign256?plain=${plain}`)
|
|
28
|
+
if (data.code !== 200) {
|
|
29
|
+
switch (data.msg) {
|
|
30
|
+
case '0x000000A0':
|
|
31
|
+
Message.warning('ukey密码错误')
|
|
32
|
+
throw new Error('ukey密码错误')
|
|
33
|
+
case '0x000000A4':
|
|
34
|
+
Message.warning('ukey被锁,请用管理员工具解锁')
|
|
35
|
+
throw new Error('ukey被锁,请用管理员工具解锁')
|
|
36
|
+
case '0x00005001':
|
|
37
|
+
Message.warning('未输入ukey密码')
|
|
38
|
+
throw new Error('未输入ukey密码')
|
|
39
|
+
default:
|
|
40
|
+
Message.warning('获取ukey异常')
|
|
41
|
+
throw new Error('获取ukey异常')
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return data.msg
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function getDN() {
|
|
48
|
+
let dn
|
|
49
|
+
let userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
|
|
50
|
+
if (userInfo && userInfo.dn) {
|
|
51
|
+
dn = userInfo.dn
|
|
52
|
+
}
|
|
53
|
+
return dn
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function getSign(plain, dn) {
|
|
57
|
+
if (dn === undefined) {
|
|
58
|
+
dn = getDN()
|
|
59
|
+
}
|
|
60
|
+
if (!dn) {
|
|
61
|
+
Message.error('签名参数DN错误!')
|
|
62
|
+
return false
|
|
63
|
+
}
|
|
64
|
+
let plainText = typeof plain === 'object' ? JSON.stringify(plain) : plain
|
|
65
|
+
|
|
66
|
+
await getKeyExist()
|
|
67
|
+
const certSN = await getCertSN()
|
|
68
|
+
if (certSN !== plainText) {
|
|
69
|
+
Message.warning('当前Ukey不匹配!')
|
|
70
|
+
throw new Error('当前Ukey不匹配!')
|
|
71
|
+
}
|
|
72
|
+
return performSign(plain + plainText)
|
|
73
|
+
}
|