unify-external-plugin-platform 0.0.2-71 → 0.0.2-72
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/dist/external-plugin.common.js +489 -522
- package/dist/external-plugin.umd.js +489 -522
- package/dist/external-plugin.umd.min.js +3 -3
- package/package.json +1 -1
@@ -84994,50 +84994,45 @@ class UdsPluginSocketService {
|
|
84994
84994
|
_defineProperty(UdsPluginSocketService, "scannerCameraUrl", 'ws://127.0.0.1:8341');
|
84995
84995
|
_defineProperty(UdsPluginSocketService, "ws", void 0);
|
84996
84996
|
_defineProperty(UdsPluginSocketService, "requestStore", []);
|
84997
|
-
;// CONCATENATED MODULE: ./packages/service/external-plugins/
|
84997
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/wei-rong-plugin-socket.service.ts
|
84998
84998
|
|
84999
84999
|
|
85000
|
-
/**
|
85001
|
-
* 沃斯德人证交互终端
|
85002
|
-
* E窗通WEBSOCKET服务
|
85003
|
-
*
|
85004
|
-
* */
|
85005
85000
|
|
85006
|
-
|
85007
|
-
|
85008
|
-
|
85009
|
-
|
85001
|
+
/**
|
85002
|
+
* @author: lvcy
|
85003
|
+
* @date: 2024-03-22
|
85004
|
+
* @description:国产客户端,硬件对接
|
85005
|
+
*/
|
85006
|
+
var WEIRONGMethodCode;
|
85007
|
+
(function (WEIRONGMethodCode) {
|
85008
|
+
/** 读卡 */
|
85009
|
+
WEIRONGMethodCode["ReadCard_Base64"] = "ReadCard_Base64";
|
85010
|
+
/** 开始签名*/
|
85011
|
+
WEIRONGMethodCode["StartSignName"] = "StartSignName";
|
85012
|
+
/** 获取签名状态*/
|
85013
|
+
WEIRONGMethodCode["GetSignNameStatus"] = "GetSignNameStatus";
|
85010
85014
|
/** 获取签名*/
|
85011
|
-
|
85012
|
-
/** 读取二代身份证 */
|
85013
|
-
EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
|
85015
|
+
WEIRONGMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
|
85014
85016
|
/** 人证比对 */
|
85015
|
-
|
85016
|
-
/**
|
85017
|
-
|
85018
|
-
|
85019
|
-
|
85020
|
-
|
85021
|
-
|
85022
|
-
[
|
85023
|
-
[
|
85024
|
-
[
|
85017
|
+
WEIRONGMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
|
85018
|
+
/** 打开高拍仪器*/
|
85019
|
+
WEIRONGMethodCode["TurnOnTheCamera"] = "TurnOnTheCamera";
|
85020
|
+
/** 拍照*/
|
85021
|
+
WEIRONGMethodCode["ScannerCamera"] = "ScannerCamera";
|
85022
|
+
})(WEIRONGMethodCode || (WEIRONGMethodCode = {}));
|
85023
|
+
const WEIRONGMethodDesc = {
|
85024
|
+
[WEIRONGMethodCode.ReadCard_Base64]: '读卡',
|
85025
|
+
[WEIRONGMethodCode.GetSignName_Base64]: '获取签名',
|
85026
|
+
[WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对'
|
85025
85027
|
};
|
85026
|
-
class
|
85028
|
+
class WeiRongPluginService {
|
85027
85029
|
static startConnect(method) {
|
85028
|
-
|
85030
|
+
console.log('startConnect', method, this.ws?.readyState, WebSocket.CONNECTING);
|
85031
|
+
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
85029
85032
|
return this;
|
85030
85033
|
}
|
85031
|
-
|
85032
|
-
|
85033
|
-
case EWindowPassMethodCode.FingerPrint_Base64:
|
85034
|
-
webSocketUrl = this.fingerPrintBasWebSocketUrl;
|
85035
|
-
break;
|
85036
|
-
default:
|
85037
|
-
webSocketUrl = this.iReadCardBasWebSocketUrl;
|
85038
|
-
break;
|
85039
|
-
}
|
85040
|
-
const ws = new WebSocket(webSocketUrl);
|
85034
|
+
console.log('重新链接');
|
85035
|
+
const ws = new WebSocket(this.webSocketUrl);
|
85041
85036
|
let resolved;
|
85042
85037
|
const onConnect = new Promise(resolve => {
|
85043
85038
|
resolved = resolve;
|
@@ -85046,15 +85041,6 @@ class EWindowPassService {
|
|
85046
85041
|
resolved(true);
|
85047
85042
|
};
|
85048
85043
|
ws.onmessage = event => {
|
85049
|
-
if (method === EWindowPassMethodCode.FingerPrint_Base64) {
|
85050
|
-
// 指纹后端返回的是string
|
85051
|
-
event = {
|
85052
|
-
...event,
|
85053
|
-
data: JSON.stringify({
|
85054
|
-
fingerPrintInfo: event.data
|
85055
|
-
})
|
85056
|
-
};
|
85057
|
-
}
|
85058
85044
|
this.handleMessage(event);
|
85059
85045
|
};
|
85060
85046
|
ws.onclose = () => this.handleClose();
|
@@ -85070,7 +85056,7 @@ class EWindowPassService {
|
|
85070
85056
|
reject('handleError');
|
85071
85057
|
});
|
85072
85058
|
}
|
85073
|
-
throw Error('
|
85059
|
+
throw Error('设备功能加载失败');
|
85074
85060
|
}
|
85075
85061
|
static handleClose() {
|
85076
85062
|
for (const type in this.requestStore) {
|
@@ -85088,61 +85074,73 @@ class EWindowPassService {
|
|
85088
85074
|
} catch (e) {
|
85089
85075
|
data = '';
|
85090
85076
|
}
|
85091
|
-
|
85092
|
-
|
85093
|
-
|
85094
|
-
|
85095
|
-
|
85096
|
-
|
85097
|
-
|
85077
|
+
if (data.method === 'FaceScreenStream' || data.method === 'VideoStream') {
|
85078
|
+
const event = new ScannerCameraRefreshPhotoEvent(data.imgBase64);
|
85079
|
+
return window.dispatchEvent(event);
|
85080
|
+
} else {
|
85081
|
+
this.requestStore.forEach(({
|
85082
|
+
resolve
|
85083
|
+
}) => {
|
85084
|
+
resolve(data);
|
85085
|
+
});
|
85086
|
+
this.requestStore = [];
|
85087
|
+
}
|
85098
85088
|
}
|
85099
85089
|
static async read(method) {
|
85100
85090
|
await this.startConnect(method);
|
85101
|
-
const methodDesc =
|
85091
|
+
const methodDesc = WEIRONGMethodDesc[method];
|
85102
85092
|
if (this.ws.readyState === 1) {
|
85103
|
-
if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
|
85104
85093
|
let jsonString;
|
85105
|
-
// outTimes:超时时间(秒)
|
85106
85094
|
switch (method) {
|
85107
|
-
case
|
85108
|
-
// cardReader:0 读卡器-USB;1 读卡器-COM
|
85095
|
+
case WEIRONGMethodCode.ReadCard_Base64:
|
85109
85096
|
jsonString = JSON.stringify({
|
85110
|
-
method,
|
85097
|
+
method: 'ReadIDCard_Base64',
|
85111
85098
|
args: {
|
85112
85099
|
outTimes: 30,
|
85113
|
-
cardReader:
|
85100
|
+
cardReader: 0
|
85114
85101
|
}
|
85115
85102
|
});
|
85116
85103
|
break;
|
85117
|
-
case
|
85118
|
-
// cardReader:0 读卡器-USB;1 读卡器-COM
|
85104
|
+
case WEIRONGMethodCode.FaceValidateWithIdCard_Base64:
|
85119
85105
|
jsonString = JSON.stringify({
|
85120
|
-
method,
|
85106
|
+
method: 'FaceValidateWithIdCard_Base64',
|
85121
85107
|
args: {
|
85122
85108
|
outTimes: 30,
|
85123
|
-
|
85124
|
-
cameraType: 0
|
85109
|
+
score: 75
|
85125
85110
|
}
|
85126
85111
|
});
|
85127
85112
|
break;
|
85128
|
-
case
|
85129
|
-
// icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
|
85113
|
+
case WEIRONGMethodCode.StartSignName:
|
85130
85114
|
jsonString = JSON.stringify({
|
85131
|
-
method,
|
85115
|
+
method: 'SignNameScreen_Start',
|
85132
85116
|
args: {
|
85133
|
-
|
85117
|
+
outTimes: 30
|
85134
85118
|
}
|
85135
85119
|
});
|
85136
85120
|
break;
|
85137
|
-
case
|
85138
|
-
|
85139
|
-
|
85121
|
+
case WEIRONGMethodCode.GetSignNameStatus:
|
85122
|
+
jsonString = JSON.stringify({
|
85123
|
+
method: 'SignNameScreen_Status',
|
85124
|
+
args: {}
|
85125
|
+
});
|
85140
85126
|
break;
|
85141
|
-
|
85127
|
+
case WEIRONGMethodCode.GetSignName_Base64:
|
85142
85128
|
jsonString = JSON.stringify({
|
85143
|
-
method,
|
85129
|
+
method: 'SignNameScreen_Get',
|
85130
|
+
args: {}
|
85131
|
+
});
|
85132
|
+
break;
|
85133
|
+
case WEIRONGMethodCode.TurnOnTheCamera:
|
85134
|
+
jsonString = JSON.stringify({
|
85135
|
+
method: 'VideoStart',
|
85136
|
+
args: {}
|
85137
|
+
});
|
85138
|
+
break;
|
85139
|
+
case WEIRONGMethodCode.ScannerCamera:
|
85140
|
+
jsonString = JSON.stringify({
|
85141
|
+
method: 'GetCameraImage',
|
85144
85142
|
args: {
|
85145
|
-
|
85143
|
+
imagePath: ''
|
85146
85144
|
}
|
85147
85145
|
});
|
85148
85146
|
break;
|
@@ -85161,441 +85159,99 @@ class EWindowPassService {
|
|
85161
85159
|
throw Error(methodDesc + '未准备完成');
|
85162
85160
|
}
|
85163
85161
|
}
|
85164
|
-
/**
|
85165
|
-
|
85166
|
-
|
85167
|
-
static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
|
85168
|
-
const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
|
85169
|
-
console.log('读取二代身份证==>', readData);
|
85162
|
+
/** 读取身份证和永居证*/
|
85163
|
+
static async idCardRead() {
|
85164
|
+
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.ReadCard_Base64);
|
85170
85165
|
if (!readData) {
|
85171
|
-
throw Error('
|
85166
|
+
throw Error('未匹配到可用的读取设备');
|
85172
85167
|
}
|
85173
85168
|
if (readData.retVal !== 0) {
|
85169
|
+
this.ws?.close();
|
85174
85170
|
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85175
85171
|
}
|
85176
|
-
|
85177
|
-
|
85172
|
+
let idInfo = readData.idInfo;
|
85173
|
+
// name:姓名 "ENfullname":"英文姓名" sex:性别 nation:民族 number 身份证号码 birthday: 生日 address: 地址,
|
85174
|
+
// organs:签发机关 signdate:开始有效期 validterm: 结束有效期
|
85175
|
+
let {
|
85178
85176
|
name,
|
85177
|
+
ENfullname: englishName,
|
85178
|
+
Nationality,
|
85179
85179
|
sex,
|
85180
85180
|
birthday,
|
85181
85181
|
address,
|
85182
|
-
|
85183
|
-
|
85182
|
+
number,
|
85183
|
+
nation,
|
85184
|
+
organs: police,
|
85185
|
+
signdate: validStart,
|
85186
|
+
validterm: validEnd
|
85184
85187
|
} = idInfo;
|
85188
|
+
let chineseName = '',
|
85189
|
+
cardType = '1',
|
85190
|
+
nationality = '中国';
|
85191
|
+
// 外国人永居证
|
85192
|
+
if (readData.cardType == 1 || readData.cardType == 2) {
|
85193
|
+
cardType = '9'; // 永居证
|
85194
|
+
chineseName = name;
|
85195
|
+
name = name || englishName; // 姓名,先读中文名,没有时读英文名
|
85196
|
+
police = police || '中华人民共和国国家移民管理局'; // 发证机关,读不到,默认
|
85197
|
+
nationality = Nationality; // 永居证国籍放在名族里面的
|
85198
|
+
nation = '';
|
85199
|
+
} else {
|
85200
|
+
// 身份证
|
85201
|
+
cardType = '1'; // 身份证
|
85202
|
+
}
|
85203
|
+
|
85185
85204
|
const IDCardData = {
|
85186
85205
|
info: {
|
85206
|
+
cardType,
|
85207
|
+
nationality,
|
85187
85208
|
name,
|
85209
|
+
chineseName,
|
85210
|
+
englishName,
|
85188
85211
|
sex,
|
85189
85212
|
birthday: birthday.replace('-', '').replace('-', ''),
|
85190
85213
|
address,
|
85191
|
-
cardId:
|
85192
|
-
nation
|
85214
|
+
cardId: number,
|
85215
|
+
nation,
|
85216
|
+
police,
|
85217
|
+
validStart,
|
85218
|
+
validEnd
|
85193
85219
|
},
|
85194
|
-
headImage: readData.
|
85220
|
+
headImage: readData.idPhotoBase64
|
85195
85221
|
};
|
85196
|
-
|
85222
|
+
this.ws?.close();
|
85197
85223
|
return IDCardData;
|
85198
85224
|
}
|
85199
|
-
/**
|
85200
|
-
|
85201
|
-
|
85202
|
-
static async faceValidateWithIdCardRead() {
|
85203
|
-
const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
|
85204
|
-
console.log('人证比对==>', readData);
|
85225
|
+
/** 读取社保卡 */
|
85226
|
+
static async socialSecurityCardRead() {
|
85227
|
+
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.ReadCard_Base64);
|
85205
85228
|
if (!readData) {
|
85206
|
-
throw Error('
|
85229
|
+
throw Error('未匹配可用的读取设备');
|
85207
85230
|
}
|
85208
85231
|
if (readData.retVal !== 0) {
|
85209
|
-
|
85232
|
+
this.ws?.close();
|
85233
|
+
throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.idInfo);
|
85210
85234
|
}
|
85211
|
-
|
85212
|
-
|
85235
|
+
// 返回数据:cardType 3 社保卡
|
85236
|
+
// idInfo: {
|
85237
|
+
// name:姓名
|
85238
|
+
// sex:性别
|
85239
|
+
// nation:民族
|
85240
|
+
// cardnumber:卡号
|
85241
|
+
// number:社会保障号码(身份证号)
|
85242
|
+
// birthday:出生日期"\
|
85243
|
+
// city:城市代码
|
85244
|
+
// signdate:开始有效期
|
85245
|
+
// validterm:结束有效期
|
85246
|
+
// cardveVrsion:社保卡版本
|
85247
|
+
// }
|
85248
|
+
const idInfo = readData.idInfo;
|
85249
|
+
let {
|
85213
85250
|
name,
|
85214
85251
|
sex,
|
85215
|
-
|
85216
|
-
|
85217
|
-
|
85218
|
-
nation
|
85219
|
-
} = idInfo;
|
85220
|
-
const IDCardData = {
|
85221
|
-
idCard: {
|
85222
|
-
info: {
|
85223
|
-
name,
|
85224
|
-
sex,
|
85225
|
-
birthday: birth.replace('-', '').replace('-', ''),
|
85226
|
-
address,
|
85227
|
-
cardId: idNo,
|
85228
|
-
nation
|
85229
|
-
},
|
85230
|
-
headImage: readData.idPhotoBase64
|
85231
|
-
},
|
85232
|
-
faceimg: readData.scenceBase64
|
85233
|
-
};
|
85234
|
-
console.log('人证比对结果==>', IDCardData);
|
85235
|
-
return IDCardData;
|
85236
|
-
}
|
85237
|
-
/** 读取社保卡 */
|
85238
|
-
static async socialSecurityCardRead() {
|
85239
|
-
const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
|
85240
|
-
if (!readData) {
|
85241
|
-
throw Error('未匹配可用的E窗通读取设备');
|
85242
|
-
}
|
85243
|
-
if (readData.retVal !== 0) {
|
85244
|
-
throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
|
85245
|
-
}
|
85246
|
-
// 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
|
85247
|
-
const outInfo = readData.outInfo;
|
85248
|
-
const outInfoArray = outInfo.split('|');
|
85249
|
-
const cardId = outInfoArray[1];
|
85250
|
-
const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
|
85251
|
-
const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
|
85252
|
-
const IDCardData = {
|
85253
|
-
info: {
|
85254
|
-
name: outInfoArray[4],
|
85255
|
-
sex,
|
85256
|
-
birthday,
|
85257
|
-
address: '',
|
85258
|
-
cardId
|
85259
|
-
},
|
85260
|
-
headImage: ''
|
85261
|
-
};
|
85262
|
-
console.log('读取社保卡==>', readData);
|
85263
|
-
return IDCardData;
|
85264
|
-
}
|
85265
|
-
/** 获取签名-base64 */
|
85266
|
-
static async signNameRead() {
|
85267
|
-
const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
|
85268
|
-
if (!readData) {
|
85269
|
-
throw Error('未匹配可用的E窗通读取设备');
|
85270
|
-
}
|
85271
|
-
if (readData.retVal !== 0) {
|
85272
|
-
throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85273
|
-
}
|
85274
|
-
console.log('获取签名==>', readData);
|
85275
|
-
return readData.signPicBase64;
|
85276
|
-
}
|
85277
|
-
/** 获取指纹*/
|
85278
|
-
static async fingerPrintRead() {
|
85279
|
-
let timeOver = 30;
|
85280
|
-
async function readFingerPrint() {
|
85281
|
-
const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
|
85282
|
-
if (!readData) {
|
85283
|
-
throw Error('未匹配可用的E窗通读取设备');
|
85284
|
-
}
|
85285
|
-
let list = readData.fingerPrintInfo.split("|");
|
85286
|
-
console.log(list);
|
85287
|
-
let ret = Number(list[1]);
|
85288
|
-
if (ret > 1) {
|
85289
|
-
if (timeOver > 0) {
|
85290
|
-
timeOver--;
|
85291
|
-
return await readFingerPrint();
|
85292
|
-
} else {
|
85293
|
-
return {
|
85294
|
-
status: 'error',
|
85295
|
-
data: '已超时,请重新操作,按压指纹'
|
85296
|
-
};
|
85297
|
-
}
|
85298
|
-
} else {
|
85299
|
-
return {
|
85300
|
-
status: 'success',
|
85301
|
-
data: readData.fingerPrintInfo
|
85302
|
-
};
|
85303
|
-
}
|
85304
|
-
}
|
85305
|
-
let {
|
85306
|
-
status,
|
85307
|
-
data
|
85308
|
-
} = await readFingerPrint();
|
85309
|
-
if (status === 'error') {
|
85310
|
-
throw Error(data);
|
85311
|
-
} else {
|
85312
|
-
let [method, result, quality, image, featureCode] = data.split('|');
|
85313
|
-
// getimgae|1|68|......|......
|
85314
|
-
// method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
|
85315
|
-
return {
|
85316
|
-
method,
|
85317
|
-
result,
|
85318
|
-
quality,
|
85319
|
-
image,
|
85320
|
-
featureCode
|
85321
|
-
};
|
85322
|
-
}
|
85323
|
-
}
|
85324
|
-
}
|
85325
|
-
_defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
|
85326
|
-
_defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
|
85327
|
-
_defineProperty(EWindowPassService, "ws", void 0);
|
85328
|
-
_defineProperty(EWindowPassService, "requestStore", []);
|
85329
|
-
;// CONCATENATED MODULE: ./packages/service/external-plugins/wei-rong-plugin-socket.service.ts
|
85330
|
-
|
85331
|
-
|
85332
|
-
|
85333
|
-
|
85334
|
-
/**
|
85335
|
-
* @author: lvcy
|
85336
|
-
* @date: 2024-03-22
|
85337
|
-
* @description:国产客户端,硬件对接
|
85338
|
-
*/
|
85339
|
-
var WEIRONGMethodCode;
|
85340
|
-
(function (WEIRONGMethodCode) {
|
85341
|
-
/** 读卡 */
|
85342
|
-
WEIRONGMethodCode["ReadCard_Base64"] = "ReadCard_Base64";
|
85343
|
-
/** 开始签名*/
|
85344
|
-
WEIRONGMethodCode["StartSignName"] = "StartSignName";
|
85345
|
-
/** 获取签名状态*/
|
85346
|
-
WEIRONGMethodCode["GetSignNameStatus"] = "GetSignNameStatus";
|
85347
|
-
/** 获取签名*/
|
85348
|
-
WEIRONGMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
|
85349
|
-
/** 人证比对 */
|
85350
|
-
WEIRONGMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
|
85351
|
-
/** 打开高拍仪器*/
|
85352
|
-
WEIRONGMethodCode["TurnOnTheCamera"] = "TurnOnTheCamera";
|
85353
|
-
/** 拍照*/
|
85354
|
-
WEIRONGMethodCode["ScannerCamera"] = "ScannerCamera";
|
85355
|
-
})(WEIRONGMethodCode || (WEIRONGMethodCode = {}));
|
85356
|
-
const WEIRONGMethodDesc = {
|
85357
|
-
[WEIRONGMethodCode.ReadCard_Base64]: '读卡',
|
85358
|
-
[WEIRONGMethodCode.GetSignName_Base64]: '获取签名',
|
85359
|
-
[WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对'
|
85360
|
-
};
|
85361
|
-
class WeiRongPluginService {
|
85362
|
-
static startConnect(method) {
|
85363
|
-
console.log('startConnect', method, this.ws?.readyState, WebSocket.CONNECTING);
|
85364
|
-
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
85365
|
-
return this;
|
85366
|
-
}
|
85367
|
-
console.log('重新链接');
|
85368
|
-
const ws = new WebSocket(this.webSocketUrl);
|
85369
|
-
let resolved;
|
85370
|
-
const onConnect = new Promise(resolve => {
|
85371
|
-
resolved = resolve;
|
85372
|
-
});
|
85373
|
-
ws.onopen = () => {
|
85374
|
-
resolved(true);
|
85375
|
-
};
|
85376
|
-
ws.onmessage = event => {
|
85377
|
-
if (method === EWindowPassMethodCode.FingerPrint_Base64) {
|
85378
|
-
// 指纹后端返回的是string
|
85379
|
-
event = {
|
85380
|
-
...event,
|
85381
|
-
data: JSON.stringify({
|
85382
|
-
fingerPrintInfo: event.data
|
85383
|
-
})
|
85384
|
-
};
|
85385
|
-
}
|
85386
|
-
this.handleMessage(event);
|
85387
|
-
};
|
85388
|
-
ws.onclose = () => this.handleClose();
|
85389
|
-
ws.onerror = () => this.handleError();
|
85390
|
-
this.ws = ws;
|
85391
|
-
return onConnect;
|
85392
|
-
}
|
85393
|
-
static handleError() {
|
85394
|
-
for (const type in this.requestStore) {
|
85395
|
-
this.requestStore.forEach(({
|
85396
|
-
reject
|
85397
|
-
}) => {
|
85398
|
-
reject('handleError');
|
85399
|
-
});
|
85400
|
-
}
|
85401
|
-
throw Error('设备功能加载失败');
|
85402
|
-
}
|
85403
|
-
static handleClose() {
|
85404
|
-
for (const type in this.requestStore) {
|
85405
|
-
this.requestStore.forEach(({
|
85406
|
-
reject
|
85407
|
-
}) => {
|
85408
|
-
reject('close');
|
85409
|
-
});
|
85410
|
-
}
|
85411
|
-
}
|
85412
|
-
static handleMessage(msg) {
|
85413
|
-
let data = '';
|
85414
|
-
try {
|
85415
|
-
data = JSON.parse(msg.data);
|
85416
|
-
} catch (e) {
|
85417
|
-
data = '';
|
85418
|
-
}
|
85419
|
-
if (data.method === 'FaceScreenStream' || data.method === 'VideoStream') {
|
85420
|
-
const event = new ScannerCameraRefreshPhotoEvent(data.imgBase64);
|
85421
|
-
return window.dispatchEvent(event);
|
85422
|
-
} else {
|
85423
|
-
this.requestStore.forEach(({
|
85424
|
-
resolve
|
85425
|
-
}) => {
|
85426
|
-
resolve(data);
|
85427
|
-
});
|
85428
|
-
this.requestStore = [];
|
85429
|
-
}
|
85430
|
-
// this.ws.close();
|
85431
|
-
}
|
85432
|
-
|
85433
|
-
static async read(method) {
|
85434
|
-
await this.startConnect(method);
|
85435
|
-
const methodDesc = WEIRONGMethodDesc[method];
|
85436
|
-
if (this.ws.readyState === 1) {
|
85437
|
-
let jsonString;
|
85438
|
-
switch (method) {
|
85439
|
-
case WEIRONGMethodCode.ReadCard_Base64:
|
85440
|
-
jsonString = JSON.stringify({
|
85441
|
-
method: 'ReadIDCard_Base64',
|
85442
|
-
args: {
|
85443
|
-
outTimes: 30,
|
85444
|
-
cardReader: 0
|
85445
|
-
}
|
85446
|
-
});
|
85447
|
-
break;
|
85448
|
-
case WEIRONGMethodCode.FaceValidateWithIdCard_Base64:
|
85449
|
-
jsonString = JSON.stringify({
|
85450
|
-
method: 'FaceValidateWithIdCard_Base64',
|
85451
|
-
args: {
|
85452
|
-
outTimes: 30,
|
85453
|
-
score: 75
|
85454
|
-
}
|
85455
|
-
});
|
85456
|
-
break;
|
85457
|
-
case WEIRONGMethodCode.StartSignName:
|
85458
|
-
jsonString = JSON.stringify({
|
85459
|
-
method: 'SignNameScreen_Start',
|
85460
|
-
args: {
|
85461
|
-
outTimes: 30
|
85462
|
-
}
|
85463
|
-
});
|
85464
|
-
break;
|
85465
|
-
case WEIRONGMethodCode.GetSignNameStatus:
|
85466
|
-
jsonString = JSON.stringify({
|
85467
|
-
method: 'SignNameScreen_Status',
|
85468
|
-
args: {}
|
85469
|
-
});
|
85470
|
-
break;
|
85471
|
-
case WEIRONGMethodCode.GetSignName_Base64:
|
85472
|
-
jsonString = JSON.stringify({
|
85473
|
-
method: 'SignNameScreen_Get',
|
85474
|
-
args: {}
|
85475
|
-
});
|
85476
|
-
break;
|
85477
|
-
case WEIRONGMethodCode.TurnOnTheCamera:
|
85478
|
-
jsonString = JSON.stringify({
|
85479
|
-
method: 'VideoStart',
|
85480
|
-
args: {}
|
85481
|
-
});
|
85482
|
-
break;
|
85483
|
-
case WEIRONGMethodCode.ScannerCamera:
|
85484
|
-
jsonString = JSON.stringify({
|
85485
|
-
method: 'GetCameraImage',
|
85486
|
-
args: {
|
85487
|
-
imagePath: ''
|
85488
|
-
}
|
85489
|
-
});
|
85490
|
-
break;
|
85491
|
-
}
|
85492
|
-
this.ws.send(jsonString);
|
85493
|
-
return new Promise((resolve, reject) => {
|
85494
|
-
if (!this.requestStore) {
|
85495
|
-
this.requestStore = [];
|
85496
|
-
}
|
85497
|
-
this.requestStore.push({
|
85498
|
-
resolve,
|
85499
|
-
reject
|
85500
|
-
});
|
85501
|
-
});
|
85502
|
-
} else {
|
85503
|
-
throw Error(methodDesc + '未准备完成');
|
85504
|
-
}
|
85505
|
-
}
|
85506
|
-
/** 读取身份证和永居证*/
|
85507
|
-
static async idCardRead() {
|
85508
|
-
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.ReadCard_Base64);
|
85509
|
-
if (!readData) {
|
85510
|
-
throw Error('未匹配到可用的读取设备');
|
85511
|
-
}
|
85512
|
-
if (readData.retVal !== 0) {
|
85513
|
-
this.ws?.close();
|
85514
|
-
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85515
|
-
}
|
85516
|
-
let idInfo = readData.idInfo;
|
85517
|
-
// name:姓名 "ENfullname":"英文姓名" sex:性别 nation:民族 number 身份证号码 birthday: 生日 address: 地址,
|
85518
|
-
// organs:签发机关 signdate:开始有效期 validterm: 结束有效期
|
85519
|
-
let {
|
85520
|
-
name,
|
85521
|
-
ENfullname: englishName,
|
85522
|
-
Nationality,
|
85523
|
-
sex,
|
85524
|
-
birthday,
|
85525
|
-
address,
|
85526
|
-
number,
|
85527
|
-
nation,
|
85528
|
-
organs: police,
|
85529
|
-
signdate: validStart,
|
85530
|
-
validterm: validEnd
|
85531
|
-
} = idInfo;
|
85532
|
-
let chineseName = '',
|
85533
|
-
cardType = '1',
|
85534
|
-
nationality = '中国';
|
85535
|
-
// 外国人永居证
|
85536
|
-
if (readData.cardType == 1 || readData.cardType == 2) {
|
85537
|
-
cardType = '9'; // 永居证
|
85538
|
-
chineseName = name;
|
85539
|
-
name = name || englishName; // 姓名,先读中文名,没有时读英文名
|
85540
|
-
police = police || '中华人民共和国国家移民管理局'; // 发证机关,读不到,默认
|
85541
|
-
nationality = Nationality; // 永居证国籍放在名族里面的
|
85542
|
-
nation = '';
|
85543
|
-
} else {
|
85544
|
-
// 身份证
|
85545
|
-
cardType = '1'; // 身份证
|
85546
|
-
}
|
85547
|
-
|
85548
|
-
const IDCardData = {
|
85549
|
-
info: {
|
85550
|
-
cardType,
|
85551
|
-
nationality,
|
85552
|
-
name,
|
85553
|
-
chineseName,
|
85554
|
-
englishName,
|
85555
|
-
sex,
|
85556
|
-
birthday: birthday.replace('-', '').replace('-', ''),
|
85557
|
-
address,
|
85558
|
-
cardId: number,
|
85559
|
-
nation,
|
85560
|
-
police,
|
85561
|
-
validStart,
|
85562
|
-
validEnd
|
85563
|
-
},
|
85564
|
-
headImage: readData.idPhotoBase64
|
85565
|
-
};
|
85566
|
-
this.ws?.close();
|
85567
|
-
return IDCardData;
|
85568
|
-
}
|
85569
|
-
/** 读取社保卡 */
|
85570
|
-
static async socialSecurityCardRead() {
|
85571
|
-
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.ReadCard_Base64);
|
85572
|
-
if (!readData) {
|
85573
|
-
throw Error('未匹配可用的读取设备');
|
85574
|
-
}
|
85575
|
-
if (readData.retVal !== 0) {
|
85576
|
-
this.ws?.close();
|
85577
|
-
throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.idInfo);
|
85578
|
-
}
|
85579
|
-
// 返回数据:cardType 3 社保卡
|
85580
|
-
// idInfo: {
|
85581
|
-
// name:姓名
|
85582
|
-
// sex:性别
|
85583
|
-
// nation:民族
|
85584
|
-
// cardnumber:卡号
|
85585
|
-
// number:社会保障号码(身份证号)
|
85586
|
-
// birthday:出生日期"\
|
85587
|
-
// city:城市代码
|
85588
|
-
// signdate:开始有效期
|
85589
|
-
// validterm:结束有效期
|
85590
|
-
// cardveVrsion:社保卡版本
|
85591
|
-
// }
|
85592
|
-
const idInfo = readData.idInfo;
|
85593
|
-
let {
|
85594
|
-
name,
|
85595
|
-
sex,
|
85596
|
-
birthday,
|
85597
|
-
number: cardId,
|
85598
|
-
cardnumber
|
85252
|
+
birthday,
|
85253
|
+
number: cardId,
|
85254
|
+
cardnumber
|
85599
85255
|
} = idInfo;
|
85600
85256
|
const IDCardData = {
|
85601
85257
|
info: {
|
@@ -85611,26 +85267,6 @@ class WeiRongPluginService {
|
|
85611
85267
|
this.ws?.close();
|
85612
85268
|
return IDCardData;
|
85613
85269
|
}
|
85614
|
-
// 港澳台居住证协议
|
85615
|
-
// {
|
85616
|
-
// "method": "ReadIDCard_Base64",
|
85617
|
-
// "retVal": 0,
|
85618
|
-
// "errMsg":"",
|
85619
|
-
// "cardType":"4",
|
85620
|
-
// "idInfo":{
|
85621
|
-
// "name":"中文姓名",
|
85622
|
-
// "sex":"性别",
|
85623
|
-
// "birthday":"出生日期",
|
85624
|
-
// "address":"(例:杭州市西湖区XXXX)",
|
85625
|
-
// "number":"证件号码",
|
85626
|
-
// "organs":"签发机关",
|
85627
|
-
// "signdate":"开始有效期",
|
85628
|
-
// "validterm":"结束有效期",
|
85629
|
-
// "signCount":"签证次数",
|
85630
|
-
// "passNu":"通行证号"
|
85631
|
-
// },
|
85632
|
-
// "idPhotoBase64":"小头像base64图片格式"
|
85633
|
-
// }
|
85634
85270
|
/**
|
85635
85271
|
* 人证比对
|
85636
85272
|
*/
|
@@ -86527,7 +86163,127 @@ class SignReadService {
|
|
86527
86163
|
ws.onopen = () => {
|
86528
86164
|
resolved(true);
|
86529
86165
|
};
|
86530
|
-
ws.onmessage = event => this.handleMessage(event);
|
86166
|
+
ws.onmessage = event => this.handleMessage(event);
|
86167
|
+
ws.onclose = () => this.handleClose();
|
86168
|
+
ws.onerror = () => this.handleError();
|
86169
|
+
this.ws = ws;
|
86170
|
+
return onConnect;
|
86171
|
+
}
|
86172
|
+
static handleError() {
|
86173
|
+
for (const type in this.requestStore) {
|
86174
|
+
this.requestStore.forEach(({
|
86175
|
+
reject
|
86176
|
+
}) => {
|
86177
|
+
reject('handleError');
|
86178
|
+
});
|
86179
|
+
}
|
86180
|
+
throw Error('签字板加载失败');
|
86181
|
+
}
|
86182
|
+
static handleClose() {
|
86183
|
+
for (const type in this.requestStore) {
|
86184
|
+
this.requestStore.forEach(({
|
86185
|
+
reject
|
86186
|
+
}) => {
|
86187
|
+
reject('close');
|
86188
|
+
});
|
86189
|
+
}
|
86190
|
+
}
|
86191
|
+
static handleMessage(msg) {
|
86192
|
+
let data = msg.data;
|
86193
|
+
this.requestStore.forEach(({
|
86194
|
+
resolve
|
86195
|
+
}) => {
|
86196
|
+
resolve(data);
|
86197
|
+
});
|
86198
|
+
this.requestStore = [];
|
86199
|
+
this.ws.close();
|
86200
|
+
}
|
86201
|
+
static async read(signMode = PluginApiType.ywSign) {
|
86202
|
+
await this.startConnect(signMode);
|
86203
|
+
if (this.ws.readyState === 1) {
|
86204
|
+
console.log('签字板连接成功');
|
86205
|
+
this.ws.send(signMode);
|
86206
|
+
return new Promise((resolve, reject) => {
|
86207
|
+
if (!this.requestStore) {
|
86208
|
+
this.requestStore = [];
|
86209
|
+
}
|
86210
|
+
this.requestStore.push({
|
86211
|
+
resolve,
|
86212
|
+
reject
|
86213
|
+
});
|
86214
|
+
});
|
86215
|
+
} else {
|
86216
|
+
throw Error('签字板未准备完成');
|
86217
|
+
}
|
86218
|
+
}
|
86219
|
+
}
|
86220
|
+
_defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chromeManage');
|
86221
|
+
_defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
|
86222
|
+
_defineProperty(SignReadService, "ws", void 0);
|
86223
|
+
_defineProperty(SignReadService, "requestStore", []);
|
86224
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/ewp-plugin-socket.service.ts
|
86225
|
+
|
86226
|
+
|
86227
|
+
/**
|
86228
|
+
* 沃斯德人证交互终端
|
86229
|
+
* E窗通WEBSOCKET服务
|
86230
|
+
*
|
86231
|
+
* */
|
86232
|
+
|
86233
|
+
var EWindowPassMethodCode;
|
86234
|
+
(function (EWindowPassMethodCode) {
|
86235
|
+
/** 读取社保卡 */
|
86236
|
+
EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
|
86237
|
+
/** 获取签名*/
|
86238
|
+
EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
|
86239
|
+
/** 读取二代身份证 */
|
86240
|
+
EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
|
86241
|
+
/** 人证比对 */
|
86242
|
+
EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
|
86243
|
+
/** 获取指纹 */
|
86244
|
+
EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
|
86245
|
+
})(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
|
86246
|
+
const EWindowPassMethodDesc = {
|
86247
|
+
[EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
|
86248
|
+
[EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
|
86249
|
+
[EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
|
86250
|
+
[EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
|
86251
|
+
[EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
|
86252
|
+
};
|
86253
|
+
class EWindowPassService {
|
86254
|
+
static startConnect(method) {
|
86255
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
86256
|
+
return this;
|
86257
|
+
}
|
86258
|
+
let webSocketUrl = '';
|
86259
|
+
switch (method) {
|
86260
|
+
case EWindowPassMethodCode.FingerPrint_Base64:
|
86261
|
+
webSocketUrl = this.fingerPrintBasWebSocketUrl;
|
86262
|
+
break;
|
86263
|
+
default:
|
86264
|
+
webSocketUrl = this.iReadCardBasWebSocketUrl;
|
86265
|
+
break;
|
86266
|
+
}
|
86267
|
+
const ws = new WebSocket(webSocketUrl);
|
86268
|
+
let resolved;
|
86269
|
+
const onConnect = new Promise(resolve => {
|
86270
|
+
resolved = resolve;
|
86271
|
+
});
|
86272
|
+
ws.onopen = () => {
|
86273
|
+
resolved(true);
|
86274
|
+
};
|
86275
|
+
ws.onmessage = event => {
|
86276
|
+
if (method === EWindowPassMethodCode.FingerPrint_Base64) {
|
86277
|
+
// 指纹后端返回的是string
|
86278
|
+
event = {
|
86279
|
+
...event,
|
86280
|
+
data: JSON.stringify({
|
86281
|
+
fingerPrintInfo: event.data
|
86282
|
+
})
|
86283
|
+
};
|
86284
|
+
}
|
86285
|
+
this.handleMessage(event);
|
86286
|
+
};
|
86531
86287
|
ws.onclose = () => this.handleClose();
|
86532
86288
|
ws.onerror = () => this.handleError();
|
86533
86289
|
this.ws = ws;
|
@@ -86541,7 +86297,7 @@ class SignReadService {
|
|
86541
86297
|
reject('handleError');
|
86542
86298
|
});
|
86543
86299
|
}
|
86544
|
-
throw Error('
|
86300
|
+
throw Error('E窗通设备功能加载失败');
|
86545
86301
|
}
|
86546
86302
|
static handleClose() {
|
86547
86303
|
for (const type in this.requestStore) {
|
@@ -86553,7 +86309,12 @@ class SignReadService {
|
|
86553
86309
|
}
|
86554
86310
|
}
|
86555
86311
|
static handleMessage(msg) {
|
86556
|
-
let data =
|
86312
|
+
let data = '';
|
86313
|
+
try {
|
86314
|
+
data = JSON.parse(msg.data);
|
86315
|
+
} catch (e) {
|
86316
|
+
data = '';
|
86317
|
+
}
|
86557
86318
|
this.requestStore.forEach(({
|
86558
86319
|
resolve
|
86559
86320
|
}) => {
|
@@ -86562,11 +86323,58 @@ class SignReadService {
|
|
86562
86323
|
this.requestStore = [];
|
86563
86324
|
this.ws.close();
|
86564
86325
|
}
|
86565
|
-
static async read(
|
86566
|
-
await this.startConnect(
|
86326
|
+
static async read(method) {
|
86327
|
+
await this.startConnect(method);
|
86328
|
+
const methodDesc = EWindowPassMethodDesc[method];
|
86567
86329
|
if (this.ws.readyState === 1) {
|
86568
|
-
console.log('
|
86569
|
-
|
86330
|
+
if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
|
86331
|
+
let jsonString;
|
86332
|
+
// outTimes:超时时间(秒)
|
86333
|
+
switch (method) {
|
86334
|
+
case EWindowPassMethodCode.ReadIDCard_Base64:
|
86335
|
+
// cardReader:0 读卡器-USB;1 读卡器-COM
|
86336
|
+
jsonString = JSON.stringify({
|
86337
|
+
method,
|
86338
|
+
args: {
|
86339
|
+
outTimes: 30,
|
86340
|
+
cardReader: 1
|
86341
|
+
}
|
86342
|
+
});
|
86343
|
+
break;
|
86344
|
+
case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
|
86345
|
+
// cardReader:0 读卡器-USB;1 读卡器-COM
|
86346
|
+
jsonString = JSON.stringify({
|
86347
|
+
method,
|
86348
|
+
args: {
|
86349
|
+
outTimes: 30,
|
86350
|
+
cardReader: 1,
|
86351
|
+
cameraType: 0
|
86352
|
+
}
|
86353
|
+
});
|
86354
|
+
break;
|
86355
|
+
case EWindowPassMethodCode.iReadCardBas:
|
86356
|
+
// icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
|
86357
|
+
jsonString = JSON.stringify({
|
86358
|
+
method,
|
86359
|
+
args: {
|
86360
|
+
icType: '1'
|
86361
|
+
}
|
86362
|
+
});
|
86363
|
+
break;
|
86364
|
+
case EWindowPassMethodCode.FingerPrint_Base64:
|
86365
|
+
// 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
|
86366
|
+
jsonString = 'getimgae,1,0,288,0';
|
86367
|
+
break;
|
86368
|
+
default:
|
86369
|
+
jsonString = JSON.stringify({
|
86370
|
+
method,
|
86371
|
+
args: {
|
86372
|
+
outTimes: 30
|
86373
|
+
}
|
86374
|
+
});
|
86375
|
+
break;
|
86376
|
+
}
|
86377
|
+
this.ws.send(jsonString);
|
86570
86378
|
return new Promise((resolve, reject) => {
|
86571
86379
|
if (!this.requestStore) {
|
86572
86380
|
this.requestStore = [];
|
@@ -86577,14 +86385,174 @@ class SignReadService {
|
|
86577
86385
|
});
|
86578
86386
|
});
|
86579
86387
|
} else {
|
86580
|
-
throw Error('
|
86388
|
+
throw Error(methodDesc + '未准备完成');
|
86389
|
+
}
|
86390
|
+
}
|
86391
|
+
/**
|
86392
|
+
* 读取二代身份证
|
86393
|
+
* */
|
86394
|
+
static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
|
86395
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
|
86396
|
+
console.log('读取二代身份证==>', readData);
|
86397
|
+
if (!readData) {
|
86398
|
+
throw Error('未匹配可用的E窗通读取设备');
|
86399
|
+
}
|
86400
|
+
if (readData.retVal !== 0) {
|
86401
|
+
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
86402
|
+
}
|
86403
|
+
const idInfo = readData.idInfo.data;
|
86404
|
+
const {
|
86405
|
+
name,
|
86406
|
+
sex,
|
86407
|
+
birthday,
|
86408
|
+
address,
|
86409
|
+
id_num,
|
86410
|
+
nations
|
86411
|
+
} = idInfo;
|
86412
|
+
const IDCardData = {
|
86413
|
+
info: {
|
86414
|
+
name,
|
86415
|
+
sex,
|
86416
|
+
birthday: birthday.replace('-', '').replace('-', ''),
|
86417
|
+
address,
|
86418
|
+
cardId: id_num,
|
86419
|
+
nation: nations
|
86420
|
+
},
|
86421
|
+
headImage: readData.idPhotoPicBase64
|
86422
|
+
};
|
86423
|
+
console.log('读取二代身份证结果==>', IDCardData);
|
86424
|
+
return IDCardData;
|
86425
|
+
}
|
86426
|
+
/**
|
86427
|
+
* 人证比对
|
86428
|
+
*/
|
86429
|
+
static async faceValidateWithIdCardRead() {
|
86430
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
|
86431
|
+
console.log('人证比对==>', readData);
|
86432
|
+
if (!readData) {
|
86433
|
+
throw Error('未匹配可用的E窗通读取设备');
|
86434
|
+
}
|
86435
|
+
if (readData.retVal !== 0) {
|
86436
|
+
throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
86437
|
+
}
|
86438
|
+
const idInfo = readData.idInfo.data;
|
86439
|
+
const {
|
86440
|
+
name,
|
86441
|
+
sex,
|
86442
|
+
birth,
|
86443
|
+
address,
|
86444
|
+
idNo,
|
86445
|
+
nation
|
86446
|
+
} = idInfo;
|
86447
|
+
const IDCardData = {
|
86448
|
+
idCard: {
|
86449
|
+
info: {
|
86450
|
+
name,
|
86451
|
+
sex,
|
86452
|
+
birthday: birth.replace('-', '').replace('-', ''),
|
86453
|
+
address,
|
86454
|
+
cardId: idNo,
|
86455
|
+
nation
|
86456
|
+
},
|
86457
|
+
headImage: readData.idPhotoBase64
|
86458
|
+
},
|
86459
|
+
faceimg: readData.scenceBase64
|
86460
|
+
};
|
86461
|
+
console.log('人证比对结果==>', IDCardData);
|
86462
|
+
return IDCardData;
|
86463
|
+
}
|
86464
|
+
/** 读取社保卡 */
|
86465
|
+
static async socialSecurityCardRead() {
|
86466
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
|
86467
|
+
if (!readData) {
|
86468
|
+
throw Error('未匹配可用的E窗通读取设备');
|
86469
|
+
}
|
86470
|
+
if (readData.retVal !== 0) {
|
86471
|
+
throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
|
86472
|
+
}
|
86473
|
+
// 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
|
86474
|
+
const outInfo = readData.outInfo;
|
86475
|
+
const outInfoArray = outInfo.split('|');
|
86476
|
+
const cardId = outInfoArray[1];
|
86477
|
+
const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
|
86478
|
+
const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
|
86479
|
+
const IDCardData = {
|
86480
|
+
info: {
|
86481
|
+
name: outInfoArray[4],
|
86482
|
+
sex,
|
86483
|
+
birthday,
|
86484
|
+
address: '',
|
86485
|
+
cardId
|
86486
|
+
},
|
86487
|
+
headImage: ''
|
86488
|
+
};
|
86489
|
+
console.log('读取社保卡==>', readData);
|
86490
|
+
return IDCardData;
|
86491
|
+
}
|
86492
|
+
/** 获取签名-base64 */
|
86493
|
+
static async signNameRead() {
|
86494
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
|
86495
|
+
if (!readData) {
|
86496
|
+
throw Error('未匹配可用的E窗通读取设备');
|
86497
|
+
}
|
86498
|
+
if (readData.retVal !== 0) {
|
86499
|
+
throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
86500
|
+
}
|
86501
|
+
console.log('获取签名==>', readData);
|
86502
|
+
return readData.signPicBase64;
|
86503
|
+
}
|
86504
|
+
/** 获取指纹*/
|
86505
|
+
static async fingerPrintRead() {
|
86506
|
+
let timeOver = 30;
|
86507
|
+
async function readFingerPrint() {
|
86508
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
|
86509
|
+
if (!readData) {
|
86510
|
+
throw Error('未匹配可用的E窗通读取设备');
|
86511
|
+
}
|
86512
|
+
let list = readData.fingerPrintInfo.split("|");
|
86513
|
+
console.log(list);
|
86514
|
+
let ret = Number(list[1]);
|
86515
|
+
if (ret > 1) {
|
86516
|
+
if (timeOver > 0) {
|
86517
|
+
timeOver--;
|
86518
|
+
return await readFingerPrint();
|
86519
|
+
} else {
|
86520
|
+
return {
|
86521
|
+
status: 'error',
|
86522
|
+
data: '已超时,请重新操作,按压指纹'
|
86523
|
+
};
|
86524
|
+
}
|
86525
|
+
} else {
|
86526
|
+
return {
|
86527
|
+
status: 'success',
|
86528
|
+
data: readData.fingerPrintInfo
|
86529
|
+
};
|
86530
|
+
}
|
86531
|
+
}
|
86532
|
+
let {
|
86533
|
+
status,
|
86534
|
+
data
|
86535
|
+
} = await readFingerPrint();
|
86536
|
+
if (status === 'error') {
|
86537
|
+
throw Error(data);
|
86538
|
+
} else {
|
86539
|
+
let [method, result, quality, image, featureCode] = data.split('|');
|
86540
|
+
// getimgae|1|68|......|......
|
86541
|
+
// method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
|
86542
|
+
return {
|
86543
|
+
method,
|
86544
|
+
result,
|
86545
|
+
quality,
|
86546
|
+
image,
|
86547
|
+
featureCode
|
86548
|
+
};
|
86581
86549
|
}
|
86582
86550
|
}
|
86583
86551
|
}
|
86584
|
-
_defineProperty(
|
86585
|
-
_defineProperty(
|
86586
|
-
_defineProperty(
|
86587
|
-
_defineProperty(
|
86552
|
+
_defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
|
86553
|
+
_defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
|
86554
|
+
_defineProperty(EWindowPassService, "ws", void 0);
|
86555
|
+
_defineProperty(EWindowPassService, "requestStore", []);
|
86588
86556
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
|
86589
86557
|
|
86590
86558
|
|
@@ -87746,8 +87714,8 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87746
87714
|
)
|
87747
87715
|
|
87748
87716
|
/* harmony default export */ var default_take_photo_dialog = (default_take_photo_dialog_component.exports);
|
87749
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/wei-rong-face-auth-dialog.vue?vue&type=template&id=
|
87750
|
-
var
|
87717
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/wei-rong-face-auth-dialog.vue?vue&type=template&id=5bbb0afc&scoped=true&
|
87718
|
+
var wei_rong_face_auth_dialogvue_type_template_id_5bbb0afc_scoped_true_render = function render() {
|
87751
87719
|
var _vm = this,
|
87752
87720
|
_c = _vm._self._c;
|
87753
87721
|
return _vm.visibility ? _c('el-dialog', {
|
@@ -87777,7 +87745,7 @@ var wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_render =
|
|
87777
87745
|
}
|
87778
87746
|
})])]) : _vm._e();
|
87779
87747
|
};
|
87780
|
-
var
|
87748
|
+
var wei_rong_face_auth_dialogvue_type_template_id_5bbb0afc_scoped_true_staticRenderFns = [];
|
87781
87749
|
|
87782
87750
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/wei-rong-face-auth-dialog.vue?vue&type=script&lang=js&
|
87783
87751
|
|
@@ -87792,7 +87760,6 @@ const wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA = 'data:image/
|
|
87792
87760
|
};
|
87793
87761
|
},
|
87794
87762
|
async created() {
|
87795
|
-
console.log();
|
87796
87763
|
window.addEventListener(SCANNER_CAMERA_REFRESH_PHOTO_EVENT, message => {
|
87797
87764
|
if (message.type === SCANNER_CAMERA_REFRESH_PHOTO_EVENT) {
|
87798
87765
|
this.viewFaceImage = `${wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA}${message.scannerResultUrl}`;
|
@@ -87817,11 +87784,11 @@ const wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA = 'data:image/
|
|
87817
87784
|
;
|
87818
87785
|
var wei_rong_face_auth_dialog_component = normalizeComponent(
|
87819
87786
|
dialog_wei_rong_face_auth_dialogvue_type_script_lang_js_,
|
87820
|
-
|
87821
|
-
|
87787
|
+
wei_rong_face_auth_dialogvue_type_template_id_5bbb0afc_scoped_true_render,
|
87788
|
+
wei_rong_face_auth_dialogvue_type_template_id_5bbb0afc_scoped_true_staticRenderFns,
|
87822
87789
|
false,
|
87823
87790
|
null,
|
87824
|
-
"
|
87791
|
+
"5bbb0afc",
|
87825
87792
|
null
|
87826
87793
|
|
87827
87794
|
)
|