n20-common-lib 1.3.151 → 1.3.153
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
|
@@ -280,11 +280,17 @@ export default {
|
|
|
280
280
|
this.$refs['login-form'].validate((valid) => {
|
|
281
281
|
if (!valid) return false
|
|
282
282
|
auth.removeToken()
|
|
283
|
-
this.beforeLogin
|
|
283
|
+
if(this.beforeLogin){
|
|
284
|
+
this.beforeLogin().then(() => {
|
|
285
|
+
this.theType === 'account' && this.passwordLogin()
|
|
286
|
+
this.theType === 'pthon' && this.phoneLogin()
|
|
287
|
+
this.theType === 'accountPthon' && this.accountPthonLogin()
|
|
288
|
+
})
|
|
289
|
+
} else {
|
|
284
290
|
this.theType === 'account' && this.passwordLogin()
|
|
285
291
|
this.theType === 'pthon' && this.phoneLogin()
|
|
286
292
|
this.theType === 'accountPthon' && this.accountPthonLogin()
|
|
287
|
-
}
|
|
293
|
+
}
|
|
288
294
|
|
|
289
295
|
})
|
|
290
296
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Notification } from 'element-ui';
|
|
1
2
|
export async function getSign(p1, p2, p3) {
|
|
2
3
|
let signType = window.sessionStorage.getItem('signType')
|
|
3
4
|
let CaMap = {
|
|
@@ -10,11 +11,51 @@ export async function getSign(p1, p2, p3) {
|
|
|
10
11
|
console.error('请设置签名服务公司sessionStorage.signType,公司字段映射:', CaMap)
|
|
11
12
|
signType = 'inetSign'
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
// 检测信安助手安装
|
|
15
|
+
async function testNetSignCNG() {
|
|
16
|
+
let num = 0
|
|
17
|
+
let flag;
|
|
18
|
+
var PortList = [63451, 63455, 63460, 52100, 52110, 52150, 43110, 45130, 47101]
|
|
19
|
+
flag = await new Promise(resolve => {
|
|
20
|
+
function getPort() {
|
|
21
|
+
const port = PortList[num]
|
|
22
|
+
let scrpt = document.createElement('script')
|
|
23
|
+
scrpt.src = `https://127.0.0.1:${port}`
|
|
24
|
+
scrpt.addEventListener('load', function () {
|
|
25
|
+
resolve(true)
|
|
26
|
+
return
|
|
27
|
+
})
|
|
28
|
+
scrpt.addEventListener('error', function () {
|
|
29
|
+
num++
|
|
30
|
+
if (num < PortList.length) {
|
|
31
|
+
getPort()
|
|
32
|
+
} else {
|
|
33
|
+
resolve(false)
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
document.body.appendChild(scrpt)
|
|
37
|
+
}
|
|
38
|
+
getPort()
|
|
39
|
+
})
|
|
40
|
+
return flag
|
|
41
|
+
}
|
|
42
|
+
const por = new Promise( (resolve) => {
|
|
14
43
|
if (signType === 'inetSign' /* 信安CA */) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
44
|
+
testNetSignCNG().then(res => {
|
|
45
|
+
if (res) {
|
|
46
|
+
import('./sign.js').then(({getSign}) => {
|
|
47
|
+
const sign = getSign(p1, p2, p3)
|
|
48
|
+
resolve(sign)
|
|
49
|
+
})
|
|
50
|
+
} else {
|
|
51
|
+
Notification({
|
|
52
|
+
title: '提示',
|
|
53
|
+
dangerouslyUseHTMLString: true,
|
|
54
|
+
message: `<div>检测到您的电脑中没有安装签名助手,为了不影响使用请使用管理员权限<a class="color-primary" href="/portal/server-assets/NetSignCNG-v2.1.152.2.exe" download>下载安装</a>NetSignCNG签名助手</div>`,
|
|
55
|
+
duration: 5000
|
|
56
|
+
})
|
|
57
|
+
resolve('')
|
|
58
|
+
}
|
|
18
59
|
})
|
|
19
60
|
} else if (signType === 'bjcaSign' /* 北京CA */) {
|
|
20
61
|
import('./bjca/index.js').then(({ getSign }) => {
|
|
@@ -28,10 +69,22 @@ export async function getSign(p1, p2, p3) {
|
|
|
28
69
|
resolve(ItrusSign)
|
|
29
70
|
})
|
|
30
71
|
} else if (signType === 'SkfSign' /* 信安国密CA */) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
72
|
+
testNetSignCNG().then(res =>{
|
|
73
|
+
if (res) {
|
|
74
|
+
import('./SkfSign/index.js').then(({getSign}) => {
|
|
75
|
+
const SkfSign = getSign(p1, p2, p3)
|
|
76
|
+
resolve(SkfSign)
|
|
77
|
+
})
|
|
78
|
+
} else {
|
|
79
|
+
Notification({
|
|
80
|
+
title: '提示',
|
|
81
|
+
dangerouslyUseHTMLString: true,
|
|
82
|
+
message: `<div>检测到您的电脑中没有安装签名助手,为了不影响使用请使用管理员权限<a class="color-primary" href="/portal/server-assets/NetSignCNG-v2.1.152.2.exe" download>下载安装</a>NetSignCNG签名助手</div>`,
|
|
83
|
+
duration: 5000
|
|
84
|
+
})
|
|
85
|
+
resolve('')
|
|
86
|
+
}
|
|
87
|
+
})
|
|
35
88
|
}
|
|
36
89
|
})
|
|
37
90
|
return por
|