unify-external-plugin-platform 0.0.2-68 → 0.0.2-69
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 +1029 -478
- package/dist/external-plugin.common.js.map +1 -1
- package/dist/external-plugin.css +1 -1
- package/dist/external-plugin.umd.js +1029 -478
- package/dist/external-plugin.umd.js.map +1 -1
- package/dist/external-plugin.umd.min.js +3 -3
- package/dist/external-plugin.umd.min.js.map +1 -1
- package/package.json +1 -1
@@ -84029,8 +84029,8 @@ var scanner_cameravue_type_template_id_00e9072f_scoped_true_render = function re
|
|
84029
84029
|
};
|
84030
84030
|
var scanner_cameravue_type_template_id_00e9072f_scoped_true_staticRenderFns = [];
|
84031
84031
|
|
84032
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=template&id=
|
84033
|
-
var
|
84032
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=template&id=bc9cce92&scoped=true&
|
84033
|
+
var scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_render = function render() {
|
84034
84034
|
var _vm = this,
|
84035
84035
|
_c = _vm._self._c;
|
84036
84036
|
return _c('div', {
|
@@ -84094,7 +84094,7 @@ var scanner_camera_componentvue_type_template_id_65e6d7b8_scoped_true_render = f
|
|
84094
84094
|
}, [_vm._v(_vm._s(item.label))]), _vm._t("action")];
|
84095
84095
|
})], 2)])]);
|
84096
84096
|
};
|
84097
|
-
var
|
84097
|
+
var scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_staticRenderFns = [];
|
84098
84098
|
|
84099
84099
|
;// CONCATENATED MODULE: ./packages/utils/custom-axios.ts
|
84100
84100
|
/**
|
@@ -85004,12 +85004,764 @@ class UdsPluginSocketService {
|
|
85004
85004
|
_defineProperty(UdsPluginSocketService, "scannerCameraUrl", 'ws://127.0.0.1:8341');
|
85005
85005
|
_defineProperty(UdsPluginSocketService, "ws", void 0);
|
85006
85006
|
_defineProperty(UdsPluginSocketService, "requestStore", []);
|
85007
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/ewp-plugin-socket.service.ts
|
85008
|
+
|
85009
|
+
|
85010
|
+
/**
|
85011
|
+
* 沃斯德人证交互终端
|
85012
|
+
* E窗通WEBSOCKET服务
|
85013
|
+
*
|
85014
|
+
* */
|
85015
|
+
|
85016
|
+
var EWindowPassMethodCode;
|
85017
|
+
(function (EWindowPassMethodCode) {
|
85018
|
+
/** 读取社保卡 */
|
85019
|
+
EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
|
85020
|
+
/** 获取签名*/
|
85021
|
+
EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
|
85022
|
+
/** 读取二代身份证 */
|
85023
|
+
EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
|
85024
|
+
/** 人证比对 */
|
85025
|
+
EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
|
85026
|
+
/** 获取指纹 */
|
85027
|
+
EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
|
85028
|
+
})(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
|
85029
|
+
const EWindowPassMethodDesc = {
|
85030
|
+
[EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
|
85031
|
+
[EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
|
85032
|
+
[EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
|
85033
|
+
[EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
|
85034
|
+
[EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
|
85035
|
+
};
|
85036
|
+
class EWindowPassService {
|
85037
|
+
static startConnect(method) {
|
85038
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85039
|
+
return this;
|
85040
|
+
}
|
85041
|
+
let webSocketUrl = '';
|
85042
|
+
switch (method) {
|
85043
|
+
case EWindowPassMethodCode.FingerPrint_Base64:
|
85044
|
+
webSocketUrl = this.fingerPrintBasWebSocketUrl;
|
85045
|
+
break;
|
85046
|
+
default:
|
85047
|
+
webSocketUrl = this.iReadCardBasWebSocketUrl;
|
85048
|
+
break;
|
85049
|
+
}
|
85050
|
+
const ws = new WebSocket(webSocketUrl);
|
85051
|
+
let resolved;
|
85052
|
+
const onConnect = new Promise(resolve => {
|
85053
|
+
resolved = resolve;
|
85054
|
+
});
|
85055
|
+
ws.onopen = () => {
|
85056
|
+
resolved(true);
|
85057
|
+
};
|
85058
|
+
ws.onmessage = event => {
|
85059
|
+
if (method === EWindowPassMethodCode.FingerPrint_Base64) {
|
85060
|
+
// 指纹后端返回的是string
|
85061
|
+
event = {
|
85062
|
+
...event,
|
85063
|
+
data: JSON.stringify({
|
85064
|
+
fingerPrintInfo: event.data
|
85065
|
+
})
|
85066
|
+
};
|
85067
|
+
}
|
85068
|
+
this.handleMessage(event);
|
85069
|
+
};
|
85070
|
+
ws.onclose = () => this.handleClose();
|
85071
|
+
ws.onerror = () => this.handleError();
|
85072
|
+
this.ws = ws;
|
85073
|
+
return onConnect;
|
85074
|
+
}
|
85075
|
+
static handleError() {
|
85076
|
+
for (const type in this.requestStore) {
|
85077
|
+
this.requestStore.forEach(({
|
85078
|
+
reject
|
85079
|
+
}) => {
|
85080
|
+
reject('handleError');
|
85081
|
+
});
|
85082
|
+
}
|
85083
|
+
throw Error('E窗通设备功能加载失败');
|
85084
|
+
}
|
85085
|
+
static handleClose() {
|
85086
|
+
for (const type in this.requestStore) {
|
85087
|
+
this.requestStore.forEach(({
|
85088
|
+
reject
|
85089
|
+
}) => {
|
85090
|
+
reject('close');
|
85091
|
+
});
|
85092
|
+
}
|
85093
|
+
}
|
85094
|
+
static handleMessage(msg) {
|
85095
|
+
let data = '';
|
85096
|
+
try {
|
85097
|
+
data = JSON.parse(msg.data);
|
85098
|
+
} catch (e) {
|
85099
|
+
data = '';
|
85100
|
+
}
|
85101
|
+
this.requestStore.forEach(({
|
85102
|
+
resolve
|
85103
|
+
}) => {
|
85104
|
+
resolve(data);
|
85105
|
+
});
|
85106
|
+
this.requestStore = [];
|
85107
|
+
this.ws.close();
|
85108
|
+
}
|
85109
|
+
static async read(method) {
|
85110
|
+
await this.startConnect(method);
|
85111
|
+
const methodDesc = EWindowPassMethodDesc[method];
|
85112
|
+
if (this.ws.readyState === 1) {
|
85113
|
+
if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
|
85114
|
+
let jsonString;
|
85115
|
+
// outTimes:超时时间(秒)
|
85116
|
+
switch (method) {
|
85117
|
+
case EWindowPassMethodCode.ReadIDCard_Base64:
|
85118
|
+
// cardReader:0 读卡器-USB;1 读卡器-COM
|
85119
|
+
jsonString = JSON.stringify({
|
85120
|
+
method,
|
85121
|
+
args: {
|
85122
|
+
outTimes: 30,
|
85123
|
+
cardReader: 1
|
85124
|
+
}
|
85125
|
+
});
|
85126
|
+
break;
|
85127
|
+
case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
|
85128
|
+
// cardReader:0 读卡器-USB;1 读卡器-COM
|
85129
|
+
jsonString = JSON.stringify({
|
85130
|
+
method,
|
85131
|
+
args: {
|
85132
|
+
outTimes: 30,
|
85133
|
+
cardReader: 1,
|
85134
|
+
cameraType: 0
|
85135
|
+
}
|
85136
|
+
});
|
85137
|
+
break;
|
85138
|
+
case EWindowPassMethodCode.iReadCardBas:
|
85139
|
+
// icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
|
85140
|
+
jsonString = JSON.stringify({
|
85141
|
+
method,
|
85142
|
+
args: {
|
85143
|
+
icType: '1'
|
85144
|
+
}
|
85145
|
+
});
|
85146
|
+
break;
|
85147
|
+
case EWindowPassMethodCode.FingerPrint_Base64:
|
85148
|
+
// 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
|
85149
|
+
jsonString = 'getimgae,1,0,288,0';
|
85150
|
+
break;
|
85151
|
+
default:
|
85152
|
+
jsonString = JSON.stringify({
|
85153
|
+
method,
|
85154
|
+
args: {
|
85155
|
+
outTimes: 30
|
85156
|
+
}
|
85157
|
+
});
|
85158
|
+
break;
|
85159
|
+
}
|
85160
|
+
this.ws.send(jsonString);
|
85161
|
+
return new Promise((resolve, reject) => {
|
85162
|
+
if (!this.requestStore) {
|
85163
|
+
this.requestStore = [];
|
85164
|
+
}
|
85165
|
+
this.requestStore.push({
|
85166
|
+
resolve,
|
85167
|
+
reject
|
85168
|
+
});
|
85169
|
+
});
|
85170
|
+
} else {
|
85171
|
+
throw Error(methodDesc + '未准备完成');
|
85172
|
+
}
|
85173
|
+
}
|
85174
|
+
/**
|
85175
|
+
* 读取二代身份证
|
85176
|
+
* */
|
85177
|
+
static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
|
85178
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
|
85179
|
+
console.log('读取二代身份证==>', readData);
|
85180
|
+
if (!readData) {
|
85181
|
+
throw Error('未匹配可用的E窗通读取设备');
|
85182
|
+
}
|
85183
|
+
if (readData.retVal !== 0) {
|
85184
|
+
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85185
|
+
}
|
85186
|
+
const idInfo = readData.idInfo.data;
|
85187
|
+
const {
|
85188
|
+
name,
|
85189
|
+
sex,
|
85190
|
+
birthday,
|
85191
|
+
address,
|
85192
|
+
id_num,
|
85193
|
+
nations
|
85194
|
+
} = idInfo;
|
85195
|
+
const IDCardData = {
|
85196
|
+
info: {
|
85197
|
+
name,
|
85198
|
+
sex,
|
85199
|
+
birthday: birthday.replace('-', '').replace('-', ''),
|
85200
|
+
address,
|
85201
|
+
cardId: id_num,
|
85202
|
+
nation: nations
|
85203
|
+
},
|
85204
|
+
headImage: readData.idPhotoPicBase64
|
85205
|
+
};
|
85206
|
+
console.log('读取二代身份证结果==>', IDCardData);
|
85207
|
+
return IDCardData;
|
85208
|
+
}
|
85209
|
+
/**
|
85210
|
+
* 人证比对
|
85211
|
+
*/
|
85212
|
+
static async faceValidateWithIdCardRead() {
|
85213
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
|
85214
|
+
console.log('人证比对==>', readData);
|
85215
|
+
if (!readData) {
|
85216
|
+
throw Error('未匹配可用的E窗通读取设备');
|
85217
|
+
}
|
85218
|
+
if (readData.retVal !== 0) {
|
85219
|
+
throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85220
|
+
}
|
85221
|
+
const idInfo = readData.idInfo.data;
|
85222
|
+
const {
|
85223
|
+
name,
|
85224
|
+
sex,
|
85225
|
+
birth,
|
85226
|
+
address,
|
85227
|
+
idNo,
|
85228
|
+
nation
|
85229
|
+
} = idInfo;
|
85230
|
+
const IDCardData = {
|
85231
|
+
idCard: {
|
85232
|
+
info: {
|
85233
|
+
name,
|
85234
|
+
sex,
|
85235
|
+
birthday: birth.replace('-', '').replace('-', ''),
|
85236
|
+
address,
|
85237
|
+
cardId: idNo,
|
85238
|
+
nation
|
85239
|
+
},
|
85240
|
+
headImage: readData.idPhotoBase64
|
85241
|
+
},
|
85242
|
+
faceimg: readData.scenceBase64
|
85243
|
+
};
|
85244
|
+
console.log('人证比对结果==>', IDCardData);
|
85245
|
+
return IDCardData;
|
85246
|
+
}
|
85247
|
+
/** 读取社保卡 */
|
85248
|
+
static async socialSecurityCardRead() {
|
85249
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
|
85250
|
+
if (!readData) {
|
85251
|
+
throw Error('未匹配可用的E窗通读取设备');
|
85252
|
+
}
|
85253
|
+
if (readData.retVal !== 0) {
|
85254
|
+
throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
|
85255
|
+
}
|
85256
|
+
// 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
|
85257
|
+
const outInfo = readData.outInfo;
|
85258
|
+
const outInfoArray = outInfo.split('|');
|
85259
|
+
const cardId = outInfoArray[1];
|
85260
|
+
const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
|
85261
|
+
const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
|
85262
|
+
const IDCardData = {
|
85263
|
+
info: {
|
85264
|
+
name: outInfoArray[4],
|
85265
|
+
sex,
|
85266
|
+
birthday,
|
85267
|
+
address: '',
|
85268
|
+
cardId
|
85269
|
+
},
|
85270
|
+
headImage: ''
|
85271
|
+
};
|
85272
|
+
console.log('读取社保卡==>', readData);
|
85273
|
+
return IDCardData;
|
85274
|
+
}
|
85275
|
+
/** 获取签名-base64 */
|
85276
|
+
static async signNameRead() {
|
85277
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
|
85278
|
+
if (!readData) {
|
85279
|
+
throw Error('未匹配可用的E窗通读取设备');
|
85280
|
+
}
|
85281
|
+
if (readData.retVal !== 0) {
|
85282
|
+
throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85283
|
+
}
|
85284
|
+
console.log('获取签名==>', readData);
|
85285
|
+
return readData.signPicBase64;
|
85286
|
+
}
|
85287
|
+
/** 获取指纹*/
|
85288
|
+
static async fingerPrintRead() {
|
85289
|
+
let timeOver = 30;
|
85290
|
+
async function readFingerPrint() {
|
85291
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
|
85292
|
+
if (!readData) {
|
85293
|
+
throw Error('未匹配可用的E窗通读取设备');
|
85294
|
+
}
|
85295
|
+
let list = readData.fingerPrintInfo.split("|");
|
85296
|
+
console.log(list);
|
85297
|
+
let ret = Number(list[1]);
|
85298
|
+
if (ret > 1) {
|
85299
|
+
if (timeOver > 0) {
|
85300
|
+
timeOver--;
|
85301
|
+
return await readFingerPrint();
|
85302
|
+
} else {
|
85303
|
+
return {
|
85304
|
+
status: 'error',
|
85305
|
+
data: '已超时,请重新操作,按压指纹'
|
85306
|
+
};
|
85307
|
+
}
|
85308
|
+
} else {
|
85309
|
+
return {
|
85310
|
+
status: 'success',
|
85311
|
+
data: readData.fingerPrintInfo
|
85312
|
+
};
|
85313
|
+
}
|
85314
|
+
}
|
85315
|
+
let {
|
85316
|
+
status,
|
85317
|
+
data
|
85318
|
+
} = await readFingerPrint();
|
85319
|
+
if (status === 'error') {
|
85320
|
+
throw Error(data);
|
85321
|
+
} else {
|
85322
|
+
let [method, result, quality, image, featureCode] = data.split('|');
|
85323
|
+
// getimgae|1|68|......|......
|
85324
|
+
// method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
|
85325
|
+
return {
|
85326
|
+
method,
|
85327
|
+
result,
|
85328
|
+
quality,
|
85329
|
+
image,
|
85330
|
+
featureCode
|
85331
|
+
};
|
85332
|
+
}
|
85333
|
+
}
|
85334
|
+
}
|
85335
|
+
_defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
|
85336
|
+
_defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
|
85337
|
+
_defineProperty(EWindowPassService, "ws", void 0);
|
85338
|
+
_defineProperty(EWindowPassService, "requestStore", []);
|
85339
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/wei-rong-plugin-socket.service.ts
|
85340
|
+
|
85341
|
+
|
85342
|
+
|
85343
|
+
|
85344
|
+
/**
|
85345
|
+
* @author: lvcy
|
85346
|
+
* @date: 2024-03-22
|
85347
|
+
* @description:国产客户端,硬件对接
|
85348
|
+
*/
|
85349
|
+
var WEIRONGMethodCode;
|
85350
|
+
(function (WEIRONGMethodCode) {
|
85351
|
+
/** 读卡 */
|
85352
|
+
WEIRONGMethodCode["ReadCard_Base64"] = "ReadCard_Base64";
|
85353
|
+
/** 开始签名*/
|
85354
|
+
WEIRONGMethodCode["StartSignName"] = "StartSignName";
|
85355
|
+
/** 获取签名状态*/
|
85356
|
+
WEIRONGMethodCode["GetSignNameStatus"] = "GetSignNameStatus";
|
85357
|
+
/** 获取签名*/
|
85358
|
+
WEIRONGMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
|
85359
|
+
/** 人证比对 */
|
85360
|
+
WEIRONGMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
|
85361
|
+
/** 打开高拍仪器*/
|
85362
|
+
WEIRONGMethodCode["TurnOnTheCamera"] = "TurnOnTheCamera";
|
85363
|
+
/** 拍照*/
|
85364
|
+
WEIRONGMethodCode["ScannerCamera"] = "ScannerCamera";
|
85365
|
+
})(WEIRONGMethodCode || (WEIRONGMethodCode = {}));
|
85366
|
+
const WEIRONGMethodDesc = {
|
85367
|
+
[WEIRONGMethodCode.ReadCard_Base64]: '读卡',
|
85368
|
+
[WEIRONGMethodCode.GetSignName_Base64]: '获取签名',
|
85369
|
+
[WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对'
|
85370
|
+
};
|
85371
|
+
class WeiRongPluginService {
|
85372
|
+
static startConnect(method) {
|
85373
|
+
console.log('startConnect', method, this.ws?.readyState, WebSocket.CONNECTING);
|
85374
|
+
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
85375
|
+
return this;
|
85376
|
+
}
|
85377
|
+
console.log('重新链接');
|
85378
|
+
const ws = new WebSocket(this.webSocketUrl);
|
85379
|
+
let resolved;
|
85380
|
+
const onConnect = new Promise(resolve => {
|
85381
|
+
resolved = resolve;
|
85382
|
+
});
|
85383
|
+
ws.onopen = () => {
|
85384
|
+
resolved(true);
|
85385
|
+
};
|
85386
|
+
ws.onmessage = event => {
|
85387
|
+
if (method === EWindowPassMethodCode.FingerPrint_Base64) {
|
85388
|
+
// 指纹后端返回的是string
|
85389
|
+
event = {
|
85390
|
+
...event,
|
85391
|
+
data: JSON.stringify({
|
85392
|
+
fingerPrintInfo: event.data
|
85393
|
+
})
|
85394
|
+
};
|
85395
|
+
}
|
85396
|
+
this.handleMessage(event);
|
85397
|
+
};
|
85398
|
+
ws.onclose = () => this.handleClose();
|
85399
|
+
ws.onerror = () => this.handleError();
|
85400
|
+
this.ws = ws;
|
85401
|
+
return onConnect;
|
85402
|
+
}
|
85403
|
+
static handleError() {
|
85404
|
+
for (const type in this.requestStore) {
|
85405
|
+
this.requestStore.forEach(({
|
85406
|
+
reject
|
85407
|
+
}) => {
|
85408
|
+
reject('handleError');
|
85409
|
+
});
|
85410
|
+
}
|
85411
|
+
throw Error('设备功能加载失败');
|
85412
|
+
}
|
85413
|
+
static handleClose() {
|
85414
|
+
for (const type in this.requestStore) {
|
85415
|
+
this.requestStore.forEach(({
|
85416
|
+
reject
|
85417
|
+
}) => {
|
85418
|
+
reject('close');
|
85419
|
+
});
|
85420
|
+
}
|
85421
|
+
}
|
85422
|
+
static handleMessage(msg) {
|
85423
|
+
let data = '';
|
85424
|
+
try {
|
85425
|
+
data = JSON.parse(msg.data);
|
85426
|
+
} catch (e) {
|
85427
|
+
data = '';
|
85428
|
+
}
|
85429
|
+
if (data.method === 'FaceScreenStream' || data.method === 'VideoStream') {
|
85430
|
+
const event = new ScannerCameraRefreshPhotoEvent(data.imgBase64);
|
85431
|
+
return window.dispatchEvent(event);
|
85432
|
+
} else {
|
85433
|
+
this.requestStore.forEach(({
|
85434
|
+
resolve
|
85435
|
+
}) => {
|
85436
|
+
resolve(data);
|
85437
|
+
});
|
85438
|
+
this.requestStore = [];
|
85439
|
+
}
|
85440
|
+
// this.ws.close();
|
85441
|
+
}
|
85442
|
+
|
85443
|
+
static async read(method) {
|
85444
|
+
await this.startConnect(method);
|
85445
|
+
const methodDesc = WEIRONGMethodDesc[method];
|
85446
|
+
if (this.ws.readyState === 1) {
|
85447
|
+
let jsonString;
|
85448
|
+
switch (method) {
|
85449
|
+
case WEIRONGMethodCode.ReadCard_Base64:
|
85450
|
+
jsonString = JSON.stringify({
|
85451
|
+
method: 'ReadIDCard_Base64',
|
85452
|
+
args: {
|
85453
|
+
outTimes: 30,
|
85454
|
+
cardReader: 0
|
85455
|
+
}
|
85456
|
+
});
|
85457
|
+
break;
|
85458
|
+
case WEIRONGMethodCode.FaceValidateWithIdCard_Base64:
|
85459
|
+
jsonString = JSON.stringify({
|
85460
|
+
method: 'FaceValidateWithIdCard_Base64',
|
85461
|
+
args: {
|
85462
|
+
outTimes: 30,
|
85463
|
+
score: 75
|
85464
|
+
}
|
85465
|
+
});
|
85466
|
+
break;
|
85467
|
+
case WEIRONGMethodCode.StartSignName:
|
85468
|
+
jsonString = JSON.stringify({
|
85469
|
+
method: 'SignNameScreen_Start',
|
85470
|
+
args: {
|
85471
|
+
outTimes: 30
|
85472
|
+
}
|
85473
|
+
});
|
85474
|
+
break;
|
85475
|
+
case WEIRONGMethodCode.GetSignNameStatus:
|
85476
|
+
jsonString = JSON.stringify({
|
85477
|
+
method: 'SignNameScreen_Status',
|
85478
|
+
args: {}
|
85479
|
+
});
|
85480
|
+
break;
|
85481
|
+
case WEIRONGMethodCode.GetSignName_Base64:
|
85482
|
+
jsonString = JSON.stringify({
|
85483
|
+
method: 'SignNameScreen_Get',
|
85484
|
+
args: {}
|
85485
|
+
});
|
85486
|
+
break;
|
85487
|
+
case WEIRONGMethodCode.TurnOnTheCamera:
|
85488
|
+
jsonString = JSON.stringify({
|
85489
|
+
method: 'VideoStart',
|
85490
|
+
args: {}
|
85491
|
+
});
|
85492
|
+
break;
|
85493
|
+
case WEIRONGMethodCode.ScannerCamera:
|
85494
|
+
jsonString = JSON.stringify({
|
85495
|
+
method: 'GetCameraImage',
|
85496
|
+
args: {
|
85497
|
+
imagePath: ''
|
85498
|
+
}
|
85499
|
+
});
|
85500
|
+
break;
|
85501
|
+
}
|
85502
|
+
this.ws.send(jsonString);
|
85503
|
+
return new Promise((resolve, reject) => {
|
85504
|
+
if (!this.requestStore) {
|
85505
|
+
this.requestStore = [];
|
85506
|
+
}
|
85507
|
+
this.requestStore.push({
|
85508
|
+
resolve,
|
85509
|
+
reject
|
85510
|
+
});
|
85511
|
+
});
|
85512
|
+
} else {
|
85513
|
+
throw Error(methodDesc + '未准备完成');
|
85514
|
+
}
|
85515
|
+
}
|
85516
|
+
/** 读取身份证和永居证*/
|
85517
|
+
static async idCardRead() {
|
85518
|
+
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.ReadCard_Base64);
|
85519
|
+
if (!readData) {
|
85520
|
+
throw Error('未匹配到可用的读取设备');
|
85521
|
+
}
|
85522
|
+
if (readData.retVal !== 0) {
|
85523
|
+
this.ws?.close();
|
85524
|
+
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85525
|
+
}
|
85526
|
+
let idInfo = readData.idInfo;
|
85527
|
+
// name:姓名 "ENfullname":"英文姓名" sex:性别 nation:民族 number 身份证号码 birthday: 生日 address: 地址,
|
85528
|
+
// organs:签发机关 signdate:开始有效期 validterm: 结束有效期
|
85529
|
+
let {
|
85530
|
+
name,
|
85531
|
+
ENfullname: englishName,
|
85532
|
+
Nationality,
|
85533
|
+
sex,
|
85534
|
+
birthday,
|
85535
|
+
address,
|
85536
|
+
number,
|
85537
|
+
nation,
|
85538
|
+
organs: police,
|
85539
|
+
signdate: validStart,
|
85540
|
+
validterm: validEnd
|
85541
|
+
} = idInfo;
|
85542
|
+
let chineseName = '',
|
85543
|
+
cardType = '1',
|
85544
|
+
nationality = '中国';
|
85545
|
+
// 外国人永居证
|
85546
|
+
if (readData.cardType == 1 || readData.cardType == 2) {
|
85547
|
+
cardType = '9'; // 永居证
|
85548
|
+
chineseName = name;
|
85549
|
+
name = name || englishName; // 姓名,先读中文名,没有时读英文名
|
85550
|
+
police = police || '中华人民共和国国家移民管理局'; // 发证机关,读不到,默认
|
85551
|
+
nationality = Nationality; // 永居证国籍放在名族里面的
|
85552
|
+
nation = '';
|
85553
|
+
} else {
|
85554
|
+
// 身份证
|
85555
|
+
cardType = '1'; // 身份证
|
85556
|
+
}
|
85557
|
+
|
85558
|
+
const IDCardData = {
|
85559
|
+
info: {
|
85560
|
+
cardType,
|
85561
|
+
nationality,
|
85562
|
+
name,
|
85563
|
+
chineseName,
|
85564
|
+
englishName,
|
85565
|
+
sex,
|
85566
|
+
birthday: birthday.replace('-', '').replace('-', ''),
|
85567
|
+
address,
|
85568
|
+
cardId: number,
|
85569
|
+
nation,
|
85570
|
+
police,
|
85571
|
+
validStart,
|
85572
|
+
validEnd
|
85573
|
+
},
|
85574
|
+
headImage: readData.idPhotoBase64
|
85575
|
+
};
|
85576
|
+
this.ws?.close();
|
85577
|
+
return IDCardData;
|
85578
|
+
}
|
85579
|
+
/** 读取社保卡 */
|
85580
|
+
static async socialSecurityCardRead() {
|
85581
|
+
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.ReadCard_Base64);
|
85582
|
+
if (!readData) {
|
85583
|
+
throw Error('未匹配可用的读取设备');
|
85584
|
+
}
|
85585
|
+
if (readData.retVal !== 0) {
|
85586
|
+
this.ws?.close();
|
85587
|
+
throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.idInfo);
|
85588
|
+
}
|
85589
|
+
// 返回数据:cardType 3 社保卡
|
85590
|
+
// idInfo: {
|
85591
|
+
// name:姓名
|
85592
|
+
// sex:性别
|
85593
|
+
// nation:民族
|
85594
|
+
// cardnumber:卡号
|
85595
|
+
// number:社会保障号码(身份证号)
|
85596
|
+
// birthday:出生日期"\
|
85597
|
+
// city:城市代码
|
85598
|
+
// signdate:开始有效期
|
85599
|
+
// validterm:结束有效期
|
85600
|
+
// cardveVrsion:社保卡版本
|
85601
|
+
// }
|
85602
|
+
const idInfo = readData.idInfo;
|
85603
|
+
let {
|
85604
|
+
name,
|
85605
|
+
sex,
|
85606
|
+
birthday,
|
85607
|
+
number: cardId,
|
85608
|
+
cardnumber
|
85609
|
+
} = idInfo;
|
85610
|
+
const IDCardData = {
|
85611
|
+
info: {
|
85612
|
+
name,
|
85613
|
+
sex,
|
85614
|
+
birthday,
|
85615
|
+
address: '',
|
85616
|
+
cardId,
|
85617
|
+
cardnumber
|
85618
|
+
},
|
85619
|
+
headImage: ''
|
85620
|
+
};
|
85621
|
+
this.ws?.close();
|
85622
|
+
return IDCardData;
|
85623
|
+
}
|
85624
|
+
// 港澳台居住证协议
|
85625
|
+
// {
|
85626
|
+
// "method": "ReadIDCard_Base64",
|
85627
|
+
// "retVal": 0,
|
85628
|
+
// "errMsg":"",
|
85629
|
+
// "cardType":"4",
|
85630
|
+
// "idInfo":{
|
85631
|
+
// "name":"中文姓名",
|
85632
|
+
// "sex":"性别",
|
85633
|
+
// "birthday":"出生日期",
|
85634
|
+
// "address":"(例:杭州市西湖区XXXX)",
|
85635
|
+
// "number":"证件号码",
|
85636
|
+
// "organs":"签发机关",
|
85637
|
+
// "signdate":"开始有效期",
|
85638
|
+
// "validterm":"结束有效期",
|
85639
|
+
// "signCount":"签证次数",
|
85640
|
+
// "passNu":"通行证号"
|
85641
|
+
// },
|
85642
|
+
// "idPhotoBase64":"小头像base64图片格式"
|
85643
|
+
// }
|
85644
|
+
/**
|
85645
|
+
* 人证比对
|
85646
|
+
*/
|
85647
|
+
static async faceValidateWithIdCardRead() {
|
85648
|
+
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.FaceValidateWithIdCard_Base64);
|
85649
|
+
if (readData.method === 'FaceValidateWithIdCard_Base64' && readData.retVal == '0') {
|
85650
|
+
console.log('认证成功=>', readData);
|
85651
|
+
const idInfo = readData.idInfo;
|
85652
|
+
let {
|
85653
|
+
name,
|
85654
|
+
ENfullname: englishName,
|
85655
|
+
Nationality,
|
85656
|
+
sex,
|
85657
|
+
birthday,
|
85658
|
+
address,
|
85659
|
+
number,
|
85660
|
+
nation,
|
85661
|
+
organs: police,
|
85662
|
+
signdate: validStart,
|
85663
|
+
validterm: validEnd
|
85664
|
+
} = idInfo;
|
85665
|
+
let chineseName = '',
|
85666
|
+
cardType = '1',
|
85667
|
+
nationality = '中国';
|
85668
|
+
// 外国人永居证
|
85669
|
+
if (readData.cardType == 1 || readData.cardType == 2) {
|
85670
|
+
cardType = '9'; // 永居证
|
85671
|
+
chineseName = name;
|
85672
|
+
name = name || englishName; // 姓名,先读中文名,没有时读英文名
|
85673
|
+
police = police || '中华人民共和国国家移民管理局'; // 发证机关,读不到,默认
|
85674
|
+
nationality = Nationality; // 永居证国籍放在名族里面的
|
85675
|
+
nation = '';
|
85676
|
+
} else {
|
85677
|
+
// 身份证
|
85678
|
+
cardType = '1'; // 身份证
|
85679
|
+
}
|
85680
|
+
// idCard:身份证信息;faceimg,拍照照片;score:对比度
|
85681
|
+
const IDCardData = {
|
85682
|
+
idCard: {
|
85683
|
+
info: {
|
85684
|
+
cardType,
|
85685
|
+
nationality,
|
85686
|
+
name,
|
85687
|
+
chineseName,
|
85688
|
+
englishName,
|
85689
|
+
sex,
|
85690
|
+
birthday: birthday.replace('-', '').replace('-', ''),
|
85691
|
+
address,
|
85692
|
+
cardId: number,
|
85693
|
+
nation,
|
85694
|
+
police,
|
85695
|
+
validStart,
|
85696
|
+
validEnd
|
85697
|
+
},
|
85698
|
+
headImage: readData.idPhotoBase64
|
85699
|
+
},
|
85700
|
+
faceimg: readData.scenceBase64,
|
85701
|
+
score: readData.score
|
85702
|
+
};
|
85703
|
+
this.ws?.close();
|
85704
|
+
return IDCardData;
|
85705
|
+
} else {
|
85706
|
+
this.ws?.close();
|
85707
|
+
}
|
85708
|
+
}
|
85709
|
+
/** 签字*/
|
85710
|
+
static async signNameRead() {
|
85711
|
+
return new Promise(async (resolve, reject) => {
|
85712
|
+
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.StartSignName);
|
85713
|
+
console.log('开始签名=>', readData);
|
85714
|
+
if (readData.method === 'SignNameScreen_Start') {
|
85715
|
+
if (readData.retVal !== 0) {
|
85716
|
+
this.ws?.close();
|
85717
|
+
reject(`开始签名失败,返回值:${readData.retVal},错误信息:${readData.errMsg}`);
|
85718
|
+
} else {
|
85719
|
+
if (!this.timer) {
|
85720
|
+
this.timer = setInterval(async () => {
|
85721
|
+
let status = await WeiRongPluginService.read(WEIRONGMethodCode.GetSignNameStatus);
|
85722
|
+
if (status.signScreenStatus == 2) {
|
85723
|
+
clearInterval(this.timer);
|
85724
|
+
this.timer = null;
|
85725
|
+
let res = await WeiRongPluginService.read(WEIRONGMethodCode.GetSignName_Base64);
|
85726
|
+
this.ws?.close();
|
85727
|
+
resolve(res.signPicBase64);
|
85728
|
+
} else if (status.retVal == 3) {
|
85729
|
+
clearInterval(this.timer);
|
85730
|
+
this.timer = null;
|
85731
|
+
this.ws?.close();
|
85732
|
+
reject('签字结果=>签字失败,或意外中断!');
|
85733
|
+
}
|
85734
|
+
}, 2000);
|
85735
|
+
}
|
85736
|
+
}
|
85737
|
+
}
|
85738
|
+
});
|
85739
|
+
}
|
85740
|
+
// 开启主摄像头/副摄像头
|
85741
|
+
static async turnOnTheCamera() {
|
85742
|
+
await WeiRongPluginService.read(WEIRONGMethodCode.TurnOnTheCamera);
|
85743
|
+
}
|
85744
|
+
// 拍照
|
85745
|
+
static async scanByCamera() {
|
85746
|
+
// if (this.ws) this.ws.close();
|
85747
|
+
let res = await WeiRongPluginService.read(WEIRONGMethodCode.ScannerCamera);
|
85748
|
+
if (res.method === 'GetCameraImage' && res.retVal == 0) {
|
85749
|
+
this.ws?.close();
|
85750
|
+
return res.cameraImgBase64;
|
85751
|
+
}
|
85752
|
+
}
|
85753
|
+
}
|
85754
|
+
_defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:5847');
|
85755
|
+
_defineProperty(WeiRongPluginService, "ws", void 0);
|
85756
|
+
_defineProperty(WeiRongPluginService, "requestStore", []);
|
85757
|
+
_defineProperty(WeiRongPluginService, "timer", null);
|
85007
85758
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
|
85008
85759
|
|
85009
85760
|
|
85010
85761
|
|
85011
85762
|
|
85012
85763
|
|
85764
|
+
|
85013
85765
|
const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/jpg;base64,';
|
85014
85766
|
/* harmony default export */ var scanner_camera_componentvue_type_script_lang_js_ = ({
|
85015
85767
|
name: "scanner-camera-component",
|
@@ -85095,6 +85847,13 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
|
|
85095
85847
|
this.$emit('send-scanner-result', `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${res}`);
|
85096
85848
|
break;
|
85097
85849
|
}
|
85850
|
+
case 6:
|
85851
|
+
{
|
85852
|
+
// 国产客户端一体机
|
85853
|
+
let res = await WeiRongPluginService.scanByCamera();
|
85854
|
+
this.$emit('send-scanner-result', `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${res}`);
|
85855
|
+
break;
|
85856
|
+
}
|
85098
85857
|
}
|
85099
85858
|
},
|
85100
85859
|
/**
|
@@ -85118,6 +85877,10 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
|
|
85118
85877
|
// 良田高拍仪
|
85119
85878
|
this.scannerVideoSrc = eloam_plugin_service_ELoamPassService.mainCameraUrl;
|
85120
85879
|
break;
|
85880
|
+
case 6:
|
85881
|
+
// 国产客户端一体机
|
85882
|
+
await WeiRongPluginService.turnOnTheCamera();
|
85883
|
+
break;
|
85121
85884
|
}
|
85122
85885
|
},
|
85123
85886
|
/**
|
@@ -85141,6 +85904,10 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
|
|
85141
85904
|
// 良田
|
85142
85905
|
this.scannerVideoSrc = eloam_plugin_service_ELoamPassService.secondaryCameraUrl;
|
85143
85906
|
break;
|
85907
|
+
case 6:
|
85908
|
+
// 国产客户端一体机
|
85909
|
+
await WeiRongPluginService.turnOnTheCamera();
|
85910
|
+
break;
|
85144
85911
|
}
|
85145
85912
|
},
|
85146
85913
|
handleAction(name) {
|
@@ -85163,10 +85930,10 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
|
|
85163
85930
|
});
|
85164
85931
|
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
|
85165
85932
|
/* harmony default export */ var component_scanner_camera_componentvue_type_script_lang_js_ = (scanner_camera_componentvue_type_script_lang_js_);
|
85166
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-67.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-67.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-67.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-67.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=
|
85933
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-67.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-67.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-67.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-67.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=bc9cce92&prod&scoped=true&lang=scss&
|
85167
85934
|
// extracted by mini-css-extract-plugin
|
85168
85935
|
|
85169
|
-
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=
|
85936
|
+
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=bc9cce92&prod&scoped=true&lang=scss&
|
85170
85937
|
|
85171
85938
|
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue
|
85172
85939
|
|
@@ -85179,11 +85946,11 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
|
|
85179
85946
|
|
85180
85947
|
var scanner_camera_component_component = normalizeComponent(
|
85181
85948
|
component_scanner_camera_componentvue_type_script_lang_js_,
|
85182
|
-
|
85183
|
-
|
85949
|
+
scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_render,
|
85950
|
+
scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_staticRenderFns,
|
85184
85951
|
false,
|
85185
85952
|
null,
|
85186
|
-
"
|
85953
|
+
"bc9cce92",
|
85187
85954
|
null
|
85188
85955
|
|
85189
85956
|
)
|
@@ -85478,8 +86245,8 @@ id_card_reader_eloam.install = Vue => {
|
|
85478
86245
|
Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
|
85479
86246
|
};
|
85480
86247
|
/* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
|
85481
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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/id-card-reader-button.vue?vue&type=template&id=
|
85482
|
-
var
|
86248
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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/id-card-reader-button.vue?vue&type=template&id=19ae37ba&scoped=true&
|
86249
|
+
var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = function render() {
|
85483
86250
|
var _vm = this,
|
85484
86251
|
_c = _vm._self._c;
|
85485
86252
|
return _vm.tip ? _c('el-tooltip', {
|
@@ -85556,7 +86323,7 @@ var id_card_reader_buttonvue_type_template_id_5b90b226_scoped_true_render = func
|
|
85556
86323
|
}
|
85557
86324
|
})], 2);
|
85558
86325
|
};
|
85559
|
-
var
|
86326
|
+
var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns = [];
|
85560
86327
|
|
85561
86328
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
|
85562
86329
|
|
@@ -85576,191 +86343,24 @@ var PluginApiType;
|
|
85576
86343
|
PluginApiType["camera"] = "sxt";
|
85577
86344
|
/**有为签字 */
|
85578
86345
|
PluginApiType["ywSign"] = "yw";
|
85579
|
-
/**汉王签字 */
|
85580
|
-
PluginApiType["hwSign"] = "hwsign";
|
85581
|
-
})(PluginApiType || (PluginApiType = {}));
|
85582
|
-
class IdCardReadService {
|
85583
|
-
// 精伦身份证 JLSFZManage
|
85584
|
-
// 之前 SFZManage
|
85585
|
-
|
85586
|
-
static startConnect(type = PluginApiType.idcard) {
|
85587
|
-
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85588
|
-
return this;
|
85589
|
-
}
|
85590
|
-
let webSocketUrl = this.idcardWebSocketUrl;
|
85591
|
-
switch (type) {
|
85592
|
-
case PluginApiType.idcard:
|
85593
|
-
webSocketUrl = this.idcardWebSocketUrl;
|
85594
|
-
break;
|
85595
|
-
case PluginApiType.jlsfz:
|
85596
|
-
webSocketUrl = this.jlsfzWebSocketUrl;
|
85597
|
-
}
|
85598
|
-
const ws = new WebSocket(webSocketUrl);
|
85599
|
-
let resolved;
|
85600
|
-
const onConnect = new Promise(resolve => {
|
85601
|
-
resolved = resolve;
|
85602
|
-
});
|
85603
|
-
ws.onopen = () => {
|
85604
|
-
resolved(true);
|
85605
|
-
};
|
85606
|
-
ws.onmessage = event => this.handleMessage(event);
|
85607
|
-
ws.onclose = () => this.handleClose();
|
85608
|
-
ws.onerror = () => this.handleError();
|
85609
|
-
this.ws = ws;
|
85610
|
-
return onConnect;
|
85611
|
-
}
|
85612
|
-
static handleError() {
|
85613
|
-
for (const type in this.requestStore) {
|
85614
|
-
this.requestStore.forEach(({
|
85615
|
-
reject
|
85616
|
-
}) => {
|
85617
|
-
reject('handleError');
|
85618
|
-
});
|
85619
|
-
}
|
85620
|
-
throw Error('读取身份证功能加载失败');
|
85621
|
-
}
|
85622
|
-
static handleClose() {
|
85623
|
-
for (const type in this.requestStore) {
|
85624
|
-
this.requestStore.forEach(({
|
85625
|
-
reject
|
85626
|
-
}) => {
|
85627
|
-
reject('close');
|
85628
|
-
});
|
85629
|
-
}
|
85630
|
-
}
|
85631
|
-
static handleMessage(msg) {
|
85632
|
-
let data = '';
|
85633
|
-
try {
|
85634
|
-
data = JSON.parse(msg.data);
|
85635
|
-
} catch (e) {
|
85636
|
-
data = '';
|
85637
|
-
}
|
85638
|
-
this.requestStore.forEach(({
|
85639
|
-
resolve
|
85640
|
-
}) => {
|
85641
|
-
resolve(data);
|
85642
|
-
});
|
85643
|
-
this.requestStore = [];
|
85644
|
-
this.ws.close();
|
85645
|
-
}
|
85646
|
-
static async read(type = PluginApiType.idcard) {
|
85647
|
-
await this.startConnect(type);
|
85648
|
-
if (this.ws.readyState === 1) {
|
85649
|
-
this.ws.send(type);
|
85650
|
-
return new Promise((resolve, reject) => {
|
85651
|
-
if (!this.requestStore) {
|
85652
|
-
this.requestStore = [];
|
85653
|
-
}
|
85654
|
-
this.requestStore.push({
|
85655
|
-
resolve,
|
85656
|
-
reject
|
85657
|
-
});
|
85658
|
-
});
|
85659
|
-
} else {
|
85660
|
-
throw Error('读取身份证未准备完成');
|
85661
|
-
}
|
85662
|
-
}
|
85663
|
-
static async idCardCommonRead() {
|
85664
|
-
let idcardInfo;
|
85665
|
-
// 顺序不要调整,先连接精伦读卡器,最后连接普通读卡器(也就是PluginApiType.idcard,因为该项读卡失败不会返回消息)
|
85666
|
-
for (const t of [PluginApiType.jlsfz, PluginApiType.idcard]) {
|
85667
|
-
const readData = await IdCardReadService.read(t);
|
85668
|
-
if (readData && readData.hasOwnProperty('info')) {
|
85669
|
-
idcardInfo = readData;
|
85670
|
-
break;
|
85671
|
-
}
|
85672
|
-
}
|
85673
|
-
if (idcardInfo) {
|
85674
|
-
return idcardInfo;
|
85675
|
-
} else {
|
85676
|
-
throw Error('未匹配可用的读卡器');
|
85677
|
-
}
|
85678
|
-
}
|
85679
|
-
}
|
85680
|
-
_defineProperty(IdCardReadService, "idcardWebSocketUrl", 'ws://127.0.0.1:8152/SFZManage');
|
85681
|
-
_defineProperty(IdCardReadService, "jlsfzWebSocketUrl", 'ws://127.0.0.1:8152/JLSFZManage');
|
85682
|
-
_defineProperty(IdCardReadService, "ws", void 0);
|
85683
|
-
_defineProperty(IdCardReadService, "requestStore", []);
|
85684
|
-
class CameraReadService {
|
85685
|
-
static startConnect() {
|
85686
|
-
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85687
|
-
return this;
|
85688
|
-
}
|
85689
|
-
let webSocketUrl = this.cameraWebSocketUrl;
|
85690
|
-
const ws = new WebSocket(webSocketUrl);
|
85691
|
-
let resolved;
|
85692
|
-
const onConnect = new Promise(resolve => {
|
85693
|
-
resolved = resolve;
|
85694
|
-
});
|
85695
|
-
ws.onopen = () => {
|
85696
|
-
resolved(true);
|
85697
|
-
};
|
85698
|
-
ws.onmessage = event => this.handleMessage(event);
|
85699
|
-
ws.onclose = () => this.handleClose();
|
85700
|
-
ws.onerror = () => this.handleError();
|
85701
|
-
this.ws = ws;
|
85702
|
-
return onConnect;
|
85703
|
-
}
|
85704
|
-
static handleError() {
|
85705
|
-
for (const type in this.requestStore) {
|
85706
|
-
this.requestStore.forEach(({
|
85707
|
-
reject
|
85708
|
-
}) => {
|
85709
|
-
reject('handleError');
|
85710
|
-
});
|
85711
|
-
}
|
85712
|
-
throw Error('读取拍照功能加载失败');
|
85713
|
-
}
|
85714
|
-
static handleClose() {
|
85715
|
-
for (const type in this.requestStore) {
|
85716
|
-
this.requestStore.forEach(({
|
85717
|
-
reject
|
85718
|
-
}) => {
|
85719
|
-
reject('close');
|
85720
|
-
});
|
85721
|
-
}
|
85722
|
-
}
|
85723
|
-
static handleMessage(msg) {
|
85724
|
-
let data = msg.data;
|
85725
|
-
this.requestStore.forEach(({
|
85726
|
-
resolve
|
85727
|
-
}) => {
|
85728
|
-
resolve(data);
|
85729
|
-
});
|
85730
|
-
this.requestStore = [];
|
85731
|
-
this.ws.close();
|
85732
|
-
// this.ws = null;
|
85733
|
-
}
|
86346
|
+
/**汉王签字 */
|
86347
|
+
PluginApiType["hwSign"] = "hwsign";
|
86348
|
+
})(PluginApiType || (PluginApiType = {}));
|
86349
|
+
class IdCardReadService {
|
86350
|
+
// 精伦身份证 JLSFZManage
|
86351
|
+
// 之前 SFZManage
|
85734
86352
|
|
85735
|
-
static
|
85736
|
-
await this.startConnect();
|
85737
|
-
if (this.ws.readyState === 1) {
|
85738
|
-
this.ws.send(PluginApiType.camera);
|
85739
|
-
return new Promise((resolve, reject) => {
|
85740
|
-
if (!this.requestStore) {
|
85741
|
-
this.requestStore = [];
|
85742
|
-
}
|
85743
|
-
this.requestStore.push({
|
85744
|
-
resolve,
|
85745
|
-
reject
|
85746
|
-
});
|
85747
|
-
});
|
85748
|
-
} else {
|
85749
|
-
throw Error('读取拍照未准备完成');
|
85750
|
-
}
|
85751
|
-
}
|
85752
|
-
}
|
85753
|
-
_defineProperty(CameraReadService, "cameraWebSocketUrl", 'ws://127.0.0.1:8152/SXTManage');
|
85754
|
-
_defineProperty(CameraReadService, "ws", void 0);
|
85755
|
-
_defineProperty(CameraReadService, "requestStore", []);
|
85756
|
-
class SignReadService {
|
85757
|
-
static startConnect(signMode) {
|
86353
|
+
static startConnect(type = PluginApiType.idcard) {
|
85758
86354
|
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85759
86355
|
return this;
|
85760
86356
|
}
|
85761
|
-
let webSocketUrl = this.
|
85762
|
-
|
85763
|
-
|
86357
|
+
let webSocketUrl = this.idcardWebSocketUrl;
|
86358
|
+
switch (type) {
|
86359
|
+
case PluginApiType.idcard:
|
86360
|
+
webSocketUrl = this.idcardWebSocketUrl;
|
86361
|
+
break;
|
86362
|
+
case PluginApiType.jlsfz:
|
86363
|
+
webSocketUrl = this.jlsfzWebSocketUrl;
|
85764
86364
|
}
|
85765
86365
|
const ws = new WebSocket(webSocketUrl);
|
85766
86366
|
let resolved;
|
@@ -85784,7 +86384,7 @@ class SignReadService {
|
|
85784
86384
|
reject('handleError');
|
85785
86385
|
});
|
85786
86386
|
}
|
85787
|
-
throw Error('
|
86387
|
+
throw Error('读取身份证功能加载失败');
|
85788
86388
|
}
|
85789
86389
|
static handleClose() {
|
85790
86390
|
for (const type in this.requestStore) {
|
@@ -85796,7 +86396,12 @@ class SignReadService {
|
|
85796
86396
|
}
|
85797
86397
|
}
|
85798
86398
|
static handleMessage(msg) {
|
85799
|
-
let data =
|
86399
|
+
let data = '';
|
86400
|
+
try {
|
86401
|
+
data = JSON.parse(msg.data);
|
86402
|
+
} catch (e) {
|
86403
|
+
data = '';
|
86404
|
+
}
|
85800
86405
|
this.requestStore.forEach(({
|
85801
86406
|
resolve
|
85802
86407
|
}) => {
|
@@ -85805,11 +86410,10 @@ class SignReadService {
|
|
85805
86410
|
this.requestStore = [];
|
85806
86411
|
this.ws.close();
|
85807
86412
|
}
|
85808
|
-
static async read(
|
85809
|
-
await this.startConnect(
|
86413
|
+
static async read(type = PluginApiType.idcard) {
|
86414
|
+
await this.startConnect(type);
|
85810
86415
|
if (this.ws.readyState === 1) {
|
85811
|
-
|
85812
|
-
this.ws.send(signMode);
|
86416
|
+
this.ws.send(type);
|
85813
86417
|
return new Promise((resolve, reject) => {
|
85814
86418
|
if (!this.requestStore) {
|
85815
86419
|
this.requestStore = [];
|
@@ -85820,57 +86424,36 @@ class SignReadService {
|
|
85820
86424
|
});
|
85821
86425
|
});
|
85822
86426
|
} else {
|
85823
|
-
throw Error('
|
86427
|
+
throw Error('读取身份证未准备完成');
|
86428
|
+
}
|
86429
|
+
}
|
86430
|
+
static async idCardCommonRead() {
|
86431
|
+
let idcardInfo;
|
86432
|
+
// 顺序不要调整,先连接精伦读卡器,最后连接普通读卡器(也就是PluginApiType.idcard,因为该项读卡失败不会返回消息)
|
86433
|
+
for (const t of [PluginApiType.jlsfz, PluginApiType.idcard]) {
|
86434
|
+
const readData = await IdCardReadService.read(t);
|
86435
|
+
if (readData && readData.hasOwnProperty('info')) {
|
86436
|
+
idcardInfo = readData;
|
86437
|
+
break;
|
86438
|
+
}
|
86439
|
+
}
|
86440
|
+
if (idcardInfo) {
|
86441
|
+
return idcardInfo;
|
86442
|
+
} else {
|
86443
|
+
throw Error('未匹配可用的读卡器');
|
85824
86444
|
}
|
85825
86445
|
}
|
85826
86446
|
}
|
85827
|
-
_defineProperty(
|
85828
|
-
_defineProperty(
|
85829
|
-
_defineProperty(
|
85830
|
-
_defineProperty(
|
85831
|
-
|
85832
|
-
|
85833
|
-
|
85834
|
-
/**
|
85835
|
-
* 沃斯德人证交互终端
|
85836
|
-
* E窗通WEBSOCKET服务
|
85837
|
-
*
|
85838
|
-
* */
|
85839
|
-
|
85840
|
-
var EWindowPassMethodCode;
|
85841
|
-
(function (EWindowPassMethodCode) {
|
85842
|
-
/** 读取社保卡 */
|
85843
|
-
EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
|
85844
|
-
/** 获取签名*/
|
85845
|
-
EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
|
85846
|
-
/** 读取二代身份证 */
|
85847
|
-
EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
|
85848
|
-
/** 人证比对 */
|
85849
|
-
EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
|
85850
|
-
/** 获取指纹 */
|
85851
|
-
EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
|
85852
|
-
})(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
|
85853
|
-
const EWindowPassMethodDesc = {
|
85854
|
-
[EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
|
85855
|
-
[EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
|
85856
|
-
[EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
|
85857
|
-
[EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
|
85858
|
-
[EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
|
85859
|
-
};
|
85860
|
-
class EWindowPassService {
|
85861
|
-
static startConnect(method) {
|
86447
|
+
_defineProperty(IdCardReadService, "idcardWebSocketUrl", 'ws://127.0.0.1:8152/SFZManage');
|
86448
|
+
_defineProperty(IdCardReadService, "jlsfzWebSocketUrl", 'ws://127.0.0.1:8152/JLSFZManage');
|
86449
|
+
_defineProperty(IdCardReadService, "ws", void 0);
|
86450
|
+
_defineProperty(IdCardReadService, "requestStore", []);
|
86451
|
+
class CameraReadService {
|
86452
|
+
static startConnect() {
|
85862
86453
|
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85863
86454
|
return this;
|
85864
86455
|
}
|
85865
|
-
let webSocketUrl =
|
85866
|
-
switch (method) {
|
85867
|
-
case EWindowPassMethodCode.FingerPrint_Base64:
|
85868
|
-
webSocketUrl = this.fingerPrintBasWebSocketUrl;
|
85869
|
-
break;
|
85870
|
-
default:
|
85871
|
-
webSocketUrl = this.iReadCardBasWebSocketUrl;
|
85872
|
-
break;
|
85873
|
-
}
|
86456
|
+
let webSocketUrl = this.cameraWebSocketUrl;
|
85874
86457
|
const ws = new WebSocket(webSocketUrl);
|
85875
86458
|
let resolved;
|
85876
86459
|
const onConnect = new Promise(resolve => {
|
@@ -85879,18 +86462,7 @@ class EWindowPassService {
|
|
85879
86462
|
ws.onopen = () => {
|
85880
86463
|
resolved(true);
|
85881
86464
|
};
|
85882
|
-
ws.onmessage = event =>
|
85883
|
-
if (method === EWindowPassMethodCode.FingerPrint_Base64) {
|
85884
|
-
// 指纹后端返回的是string
|
85885
|
-
event = {
|
85886
|
-
...event,
|
85887
|
-
data: JSON.stringify({
|
85888
|
-
fingerPrintInfo: event.data
|
85889
|
-
})
|
85890
|
-
};
|
85891
|
-
}
|
85892
|
-
this.handleMessage(event);
|
85893
|
-
};
|
86465
|
+
ws.onmessage = event => this.handleMessage(event);
|
85894
86466
|
ws.onclose = () => this.handleClose();
|
85895
86467
|
ws.onerror = () => this.handleError();
|
85896
86468
|
this.ws = ws;
|
@@ -85904,7 +86476,7 @@ class EWindowPassService {
|
|
85904
86476
|
reject('handleError');
|
85905
86477
|
});
|
85906
86478
|
}
|
85907
|
-
throw Error('
|
86479
|
+
throw Error('读取拍照功能加载失败');
|
85908
86480
|
}
|
85909
86481
|
static handleClose() {
|
85910
86482
|
for (const type in this.requestStore) {
|
@@ -85916,12 +86488,7 @@ class EWindowPassService {
|
|
85916
86488
|
}
|
85917
86489
|
}
|
85918
86490
|
static handleMessage(msg) {
|
85919
|
-
let data =
|
85920
|
-
try {
|
85921
|
-
data = JSON.parse(msg.data);
|
85922
|
-
} catch (e) {
|
85923
|
-
data = '';
|
85924
|
-
}
|
86491
|
+
let data = msg.data;
|
85925
86492
|
this.requestStore.forEach(({
|
85926
86493
|
resolve
|
85927
86494
|
}) => {
|
@@ -85929,237 +86496,105 @@ class EWindowPassService {
|
|
85929
86496
|
});
|
85930
86497
|
this.requestStore = [];
|
85931
86498
|
this.ws.close();
|
86499
|
+
// this.ws = null;
|
85932
86500
|
}
|
85933
|
-
|
85934
|
-
|
85935
|
-
|
86501
|
+
|
86502
|
+
static async read() {
|
86503
|
+
await this.startConnect();
|
85936
86504
|
if (this.ws.readyState === 1) {
|
85937
|
-
|
85938
|
-
let jsonString;
|
85939
|
-
// outTimes:超时时间(秒)
|
85940
|
-
switch (method) {
|
85941
|
-
case EWindowPassMethodCode.ReadIDCard_Base64:
|
85942
|
-
// cardReader:0 读卡器-USB;1 读卡器-COM
|
85943
|
-
jsonString = JSON.stringify({
|
85944
|
-
method,
|
85945
|
-
args: {
|
85946
|
-
outTimes: 30,
|
85947
|
-
cardReader: 1
|
85948
|
-
}
|
85949
|
-
});
|
85950
|
-
break;
|
85951
|
-
case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
|
85952
|
-
// cardReader:0 读卡器-USB;1 读卡器-COM
|
85953
|
-
jsonString = JSON.stringify({
|
85954
|
-
method,
|
85955
|
-
args: {
|
85956
|
-
outTimes: 30,
|
85957
|
-
cardReader: 1,
|
85958
|
-
cameraType: 0
|
85959
|
-
}
|
85960
|
-
});
|
85961
|
-
break;
|
85962
|
-
case EWindowPassMethodCode.iReadCardBas:
|
85963
|
-
// icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
|
85964
|
-
jsonString = JSON.stringify({
|
85965
|
-
method,
|
85966
|
-
args: {
|
85967
|
-
icType: '1'
|
85968
|
-
}
|
85969
|
-
});
|
85970
|
-
break;
|
85971
|
-
case EWindowPassMethodCode.FingerPrint_Base64:
|
85972
|
-
// 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
|
85973
|
-
jsonString = 'getimgae,1,0,288,0';
|
85974
|
-
break;
|
85975
|
-
default:
|
85976
|
-
jsonString = JSON.stringify({
|
85977
|
-
method,
|
85978
|
-
args: {
|
85979
|
-
outTimes: 30
|
85980
|
-
}
|
85981
|
-
});
|
85982
|
-
break;
|
85983
|
-
}
|
85984
|
-
this.ws.send(jsonString);
|
86505
|
+
this.ws.send(PluginApiType.camera);
|
85985
86506
|
return new Promise((resolve, reject) => {
|
85986
86507
|
if (!this.requestStore) {
|
85987
86508
|
this.requestStore = [];
|
85988
86509
|
}
|
85989
86510
|
this.requestStore.push({
|
85990
86511
|
resolve,
|
85991
|
-
reject
|
85992
|
-
});
|
85993
|
-
});
|
85994
|
-
} else {
|
85995
|
-
throw Error(
|
85996
|
-
}
|
85997
|
-
}
|
85998
|
-
/**
|
85999
|
-
* 读取二代身份证
|
86000
|
-
* */
|
86001
|
-
static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
|
86002
|
-
const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
|
86003
|
-
console.log('读取二代身份证==>', readData);
|
86004
|
-
if (!readData) {
|
86005
|
-
throw Error('未匹配可用的E窗通读取设备');
|
86006
|
-
}
|
86007
|
-
if (readData.retVal !== 0) {
|
86008
|
-
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
86009
|
-
}
|
86010
|
-
const idInfo = readData.idInfo.data;
|
86011
|
-
const {
|
86012
|
-
name,
|
86013
|
-
sex,
|
86014
|
-
birthday,
|
86015
|
-
address,
|
86016
|
-
id_num,
|
86017
|
-
nations
|
86018
|
-
} = idInfo;
|
86019
|
-
const IDCardData = {
|
86020
|
-
info: {
|
86021
|
-
name,
|
86022
|
-
sex,
|
86023
|
-
birthday: birthday.replace('-', '').replace('-', ''),
|
86024
|
-
address,
|
86025
|
-
cardId: id_num,
|
86026
|
-
nation: nations
|
86027
|
-
},
|
86028
|
-
headImage: readData.idPhotoPicBase64
|
86029
|
-
};
|
86030
|
-
console.log('读取二代身份证结果==>', IDCardData);
|
86031
|
-
return IDCardData;
|
86032
|
-
}
|
86033
|
-
/**
|
86034
|
-
* 人证比对
|
86035
|
-
*/
|
86036
|
-
static async faceValidateWithIdCardRead() {
|
86037
|
-
const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
|
86038
|
-
console.log('人证比对==>', readData);
|
86039
|
-
if (!readData) {
|
86040
|
-
throw Error('未匹配可用的E窗通读取设备');
|
86041
|
-
}
|
86042
|
-
if (readData.retVal !== 0) {
|
86043
|
-
throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
86512
|
+
reject
|
86513
|
+
});
|
86514
|
+
});
|
86515
|
+
} else {
|
86516
|
+
throw Error('读取拍照未准备完成');
|
86044
86517
|
}
|
86045
|
-
const idInfo = readData.idInfo.data;
|
86046
|
-
const {
|
86047
|
-
name,
|
86048
|
-
sex,
|
86049
|
-
birth,
|
86050
|
-
address,
|
86051
|
-
idNo,
|
86052
|
-
nation
|
86053
|
-
} = idInfo;
|
86054
|
-
const IDCardData = {
|
86055
|
-
idCard: {
|
86056
|
-
info: {
|
86057
|
-
name,
|
86058
|
-
sex,
|
86059
|
-
birthday: birth.replace('-', '').replace('-', ''),
|
86060
|
-
address,
|
86061
|
-
cardId: idNo,
|
86062
|
-
nation
|
86063
|
-
},
|
86064
|
-
headImage: readData.idPhotoBase64
|
86065
|
-
},
|
86066
|
-
faceimg: readData.scenceBase64
|
86067
|
-
};
|
86068
|
-
console.log('人证比对结果==>', IDCardData);
|
86069
|
-
return IDCardData;
|
86070
86518
|
}
|
86071
|
-
|
86072
|
-
|
86073
|
-
|
86074
|
-
|
86075
|
-
|
86519
|
+
}
|
86520
|
+
_defineProperty(CameraReadService, "cameraWebSocketUrl", 'ws://127.0.0.1:8152/SXTManage');
|
86521
|
+
_defineProperty(CameraReadService, "ws", void 0);
|
86522
|
+
_defineProperty(CameraReadService, "requestStore", []);
|
86523
|
+
class SignReadService {
|
86524
|
+
static startConnect(signMode) {
|
86525
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
86526
|
+
return this;
|
86076
86527
|
}
|
86077
|
-
|
86078
|
-
|
86528
|
+
let webSocketUrl = this.signWebSocketUrl;
|
86529
|
+
if (signMode === PluginApiType.hwSign) {
|
86530
|
+
webSocketUrl = this.hwSignWebSocketUrl;
|
86079
86531
|
}
|
86080
|
-
|
86081
|
-
|
86082
|
-
const
|
86083
|
-
|
86084
|
-
|
86085
|
-
|
86086
|
-
|
86087
|
-
info: {
|
86088
|
-
name: outInfoArray[4],
|
86089
|
-
sex,
|
86090
|
-
birthday,
|
86091
|
-
address: '',
|
86092
|
-
cardId
|
86093
|
-
},
|
86094
|
-
headImage: ''
|
86532
|
+
const ws = new WebSocket(webSocketUrl);
|
86533
|
+
let resolved;
|
86534
|
+
const onConnect = new Promise(resolve => {
|
86535
|
+
resolved = resolve;
|
86536
|
+
});
|
86537
|
+
ws.onopen = () => {
|
86538
|
+
resolved(true);
|
86095
86539
|
};
|
86096
|
-
|
86097
|
-
|
86540
|
+
ws.onmessage = event => this.handleMessage(event);
|
86541
|
+
ws.onclose = () => this.handleClose();
|
86542
|
+
ws.onerror = () => this.handleError();
|
86543
|
+
this.ws = ws;
|
86544
|
+
return onConnect;
|
86098
86545
|
}
|
86099
|
-
|
86100
|
-
|
86101
|
-
|
86102
|
-
|
86103
|
-
|
86546
|
+
static handleError() {
|
86547
|
+
for (const type in this.requestStore) {
|
86548
|
+
this.requestStore.forEach(({
|
86549
|
+
reject
|
86550
|
+
}) => {
|
86551
|
+
reject('handleError');
|
86552
|
+
});
|
86104
86553
|
}
|
86105
|
-
|
86106
|
-
|
86554
|
+
throw Error('签字板加载失败');
|
86555
|
+
}
|
86556
|
+
static handleClose() {
|
86557
|
+
for (const type in this.requestStore) {
|
86558
|
+
this.requestStore.forEach(({
|
86559
|
+
reject
|
86560
|
+
}) => {
|
86561
|
+
reject('close');
|
86562
|
+
});
|
86107
86563
|
}
|
86108
|
-
console.log('获取签名==>', readData);
|
86109
|
-
return readData.signPicBase64;
|
86110
86564
|
}
|
86111
|
-
|
86112
|
-
|
86113
|
-
|
86114
|
-
|
86115
|
-
|
86116
|
-
|
86117
|
-
|
86118
|
-
|
86119
|
-
|
86120
|
-
|
86121
|
-
|
86122
|
-
|
86123
|
-
|
86124
|
-
|
86125
|
-
|
86126
|
-
|
86127
|
-
|
86128
|
-
|
86129
|
-
data: '已超时,请重新操作,按压指纹'
|
86130
|
-
};
|
86565
|
+
static handleMessage(msg) {
|
86566
|
+
let data = msg.data;
|
86567
|
+
this.requestStore.forEach(({
|
86568
|
+
resolve
|
86569
|
+
}) => {
|
86570
|
+
resolve(data);
|
86571
|
+
});
|
86572
|
+
this.requestStore = [];
|
86573
|
+
this.ws.close();
|
86574
|
+
}
|
86575
|
+
static async read(signMode = PluginApiType.ywSign) {
|
86576
|
+
await this.startConnect(signMode);
|
86577
|
+
if (this.ws.readyState === 1) {
|
86578
|
+
console.log('签字板连接成功');
|
86579
|
+
this.ws.send(signMode);
|
86580
|
+
return new Promise((resolve, reject) => {
|
86581
|
+
if (!this.requestStore) {
|
86582
|
+
this.requestStore = [];
|
86131
86583
|
}
|
86132
|
-
|
86133
|
-
|
86134
|
-
|
86135
|
-
|
86136
|
-
|
86137
|
-
}
|
86138
|
-
}
|
86139
|
-
let {
|
86140
|
-
status,
|
86141
|
-
data
|
86142
|
-
} = await readFingerPrint();
|
86143
|
-
if (status === 'error') {
|
86144
|
-
throw Error(data);
|
86584
|
+
this.requestStore.push({
|
86585
|
+
resolve,
|
86586
|
+
reject
|
86587
|
+
});
|
86588
|
+
});
|
86145
86589
|
} else {
|
86146
|
-
|
86147
|
-
// getimgae|1|68|......|......
|
86148
|
-
// method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
|
86149
|
-
return {
|
86150
|
-
method,
|
86151
|
-
result,
|
86152
|
-
quality,
|
86153
|
-
image,
|
86154
|
-
featureCode
|
86155
|
-
};
|
86590
|
+
throw Error('签字板未准备完成');
|
86156
86591
|
}
|
86157
86592
|
}
|
86158
86593
|
}
|
86159
|
-
_defineProperty(
|
86160
|
-
_defineProperty(
|
86161
|
-
_defineProperty(
|
86162
|
-
_defineProperty(
|
86594
|
+
_defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chromeManage');
|
86595
|
+
_defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
|
86596
|
+
_defineProperty(SignReadService, "ws", void 0);
|
86597
|
+
_defineProperty(SignReadService, "requestStore", []);
|
86163
86598
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
|
86164
86599
|
|
86165
86600
|
|
@@ -87321,6 +87756,87 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87321
87756
|
)
|
87322
87757
|
|
87323
87758
|
/* harmony default export */ var default_take_photo_dialog = (default_take_photo_dialog_component.exports);
|
87759
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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=d49bc744&scoped=true&
|
87760
|
+
var wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_render = function render() {
|
87761
|
+
var _vm = this,
|
87762
|
+
_c = _vm._self._c;
|
87763
|
+
return _vm.visibility ? _c('el-dialog', {
|
87764
|
+
staticClass: "wei-rong-face-auth-dialog",
|
87765
|
+
attrs: {
|
87766
|
+
"title": "人脸识别",
|
87767
|
+
"top": '5vh',
|
87768
|
+
"width": "640px",
|
87769
|
+
"visible": _vm.visibility,
|
87770
|
+
"close-on-click-modal": false
|
87771
|
+
},
|
87772
|
+
on: {
|
87773
|
+
"update:visible": function ($event) {
|
87774
|
+
_vm.visibility = $event;
|
87775
|
+
}
|
87776
|
+
}
|
87777
|
+
}, [_c('div', {
|
87778
|
+
staticClass: "image-container"
|
87779
|
+
}, [_c('img', {
|
87780
|
+
staticStyle: {
|
87781
|
+
"width": "600px",
|
87782
|
+
"height": "450px"
|
87783
|
+
},
|
87784
|
+
attrs: {
|
87785
|
+
"id": "photo",
|
87786
|
+
"src": _vm.viewFaceImage
|
87787
|
+
}
|
87788
|
+
})])]) : _vm._e();
|
87789
|
+
};
|
87790
|
+
var wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_staticRenderFns = [];
|
87791
|
+
|
87792
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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&
|
87793
|
+
|
87794
|
+
|
87795
|
+
const wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA = 'data:image/jpg;base64,';
|
87796
|
+
/* harmony default export */ var wei_rong_face_auth_dialogvue_type_script_lang_js_ = ({
|
87797
|
+
name: "wei-rong-face-auth-dialog",
|
87798
|
+
data: () => {
|
87799
|
+
return {
|
87800
|
+
visibility: true,
|
87801
|
+
viewFaceImage: ''
|
87802
|
+
};
|
87803
|
+
},
|
87804
|
+
async created() {
|
87805
|
+
console.log();
|
87806
|
+
window.addEventListener(SCANNER_CAMERA_REFRESH_PHOTO_EVENT, message => {
|
87807
|
+
if (message.type === SCANNER_CAMERA_REFRESH_PHOTO_EVENT) {
|
87808
|
+
this.viewFaceImage = `${wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA}${message.scannerResultUrl}`;
|
87809
|
+
}
|
87810
|
+
});
|
87811
|
+
let res = await WeiRongPluginService.faceValidateWithIdCardRead();
|
87812
|
+
this.$message.success('认证成功');
|
87813
|
+
setTimeout(() => {
|
87814
|
+
this.$emit('close', res);
|
87815
|
+
}, 1500);
|
87816
|
+
}
|
87817
|
+
});
|
87818
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/wei-rong-face-auth-dialog.vue?vue&type=script&lang=js&
|
87819
|
+
/* harmony default export */ var dialog_wei_rong_face_auth_dialogvue_type_script_lang_js_ = (wei_rong_face_auth_dialogvue_type_script_lang_js_);
|
87820
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/wei-rong-face-auth-dialog.vue
|
87821
|
+
|
87822
|
+
|
87823
|
+
|
87824
|
+
|
87825
|
+
|
87826
|
+
/* normalize component */
|
87827
|
+
;
|
87828
|
+
var wei_rong_face_auth_dialog_component = normalizeComponent(
|
87829
|
+
dialog_wei_rong_face_auth_dialogvue_type_script_lang_js_,
|
87830
|
+
wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_render,
|
87831
|
+
wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_staticRenderFns,
|
87832
|
+
false,
|
87833
|
+
null,
|
87834
|
+
"d49bc744",
|
87835
|
+
null
|
87836
|
+
|
87837
|
+
)
|
87838
|
+
|
87839
|
+
/* harmony default export */ var wei_rong_face_auth_dialog = (wei_rong_face_auth_dialog_component.exports);
|
87324
87840
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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/id-card-reader-button.vue?vue&type=script&lang=js&
|
87325
87841
|
|
87326
87842
|
|
@@ -87335,6 +87851,8 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87335
87851
|
|
87336
87852
|
|
87337
87853
|
|
87854
|
+
|
87855
|
+
|
87338
87856
|
/* harmony default export */ var id_card_reader_buttonvue_type_script_lang_js_ = ({
|
87339
87857
|
name: 'id-card-reader-button',
|
87340
87858
|
props: {
|
@@ -87382,10 +87900,10 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87382
87900
|
type: Boolean
|
87383
87901
|
},
|
87384
87902
|
/**
|
87385
|
-
* 读卡器:0-默认读卡器及精伦读卡器;1-丽水一体机;2-沃斯德人证交互终端;3-中正人脸识别;4-华大读卡器;5-良田;6-捷宇信息交互终端;7-太极云软/Z300;8-华视电子读卡器;9
|
87386
|
-
* 人脸识别:0-默认人脸识别(拍照);1-丽水一体机 2-沃斯德人证交互终端;3-中正人脸识别;5-良田;6
|
87387
|
-
* 读取社保卡:2-沃斯德人证交互终端;4
|
87388
|
-
* 签字版:0-有为签字版;1-汉王签字版;2-沃斯德人证交互终端签字;3-捷宇信息交互终端;4-太极云软签字/P-300;
|
87903
|
+
* 读卡器:0-默认读卡器及精伦读卡器;1-丽水一体机;2-沃斯德人证交互终端;3-中正人脸识别;4-华大读卡器;5-良田;6-捷宇信息交互终端;7-太极云软/Z300;8-华视电子读卡器;9-捷宇高拍仪读卡; 10-国产客户端一体机
|
87904
|
+
* 人脸识别:0-默认人脸识别(拍照);1-丽水一体机 2-沃斯德人证交互终端;3-中正人脸识别;5-良田;6-捷宇信息交互终端;10-国产客户端一体机
|
87905
|
+
* 读取社保卡:2-沃斯德人证交互终端;4-华大读卡器;5-国产客户端一体机
|
87906
|
+
* 签字版:0-有为签字版;1-汉王签字版;2-沃斯德人证交互终端签字;3-捷宇信息交互终端;4-太极云软签字/P-300;5:国产客户端签字版
|
87389
87907
|
*/
|
87390
87908
|
readMachineType: {
|
87391
87909
|
default: 0,
|
@@ -87498,6 +88016,10 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87498
88016
|
idcardInfo = await JieYueService.idCardReadByScanner();
|
87499
88017
|
this.$emit('click', idcardInfo);
|
87500
88018
|
break;
|
88019
|
+
case 10:
|
88020
|
+
idcardInfo = await WeiRongPluginService.idCardRead();
|
88021
|
+
this.$emit('click', idcardInfo);
|
88022
|
+
break;
|
87501
88023
|
}
|
87502
88024
|
},
|
87503
88025
|
/**
|
@@ -87536,6 +88058,9 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87536
88058
|
this.$emit('click', data);
|
87537
88059
|
break;
|
87538
88060
|
}
|
88061
|
+
case 10:
|
88062
|
+
this.openWEIRONGFaceValidateDialog();
|
88063
|
+
break;
|
87539
88064
|
}
|
87540
88065
|
},
|
87541
88066
|
/**
|
@@ -87551,6 +88076,9 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87551
88076
|
case 4:
|
87552
88077
|
idcardInfo = await HuzReadService.socialSecurityCardRead();
|
87553
88078
|
break;
|
88079
|
+
case 5:
|
88080
|
+
idcardInfo = await WeiRongPluginService.socialSecurityCardRead();
|
88081
|
+
break;
|
87554
88082
|
}
|
87555
88083
|
this.$emit('click', idcardInfo);
|
87556
88084
|
} catch (e) {
|
@@ -87593,6 +88121,9 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87593
88121
|
userSignature = SignName0;
|
87594
88122
|
}
|
87595
88123
|
break;
|
88124
|
+
case 5:
|
88125
|
+
userSignature = await WeiRongPluginService.signNameRead();
|
88126
|
+
break;
|
87596
88127
|
}
|
87597
88128
|
// 返回base64编码内容,无前缀
|
87598
88129
|
this.$emit('click', userSignature);
|
@@ -87624,6 +88155,26 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87624
88155
|
parent: this
|
87625
88156
|
}).$mount(modalNode);
|
87626
88157
|
},
|
88158
|
+
openWEIRONGFaceValidateDialog() {
|
88159
|
+
console.log('打开人脸识别弹框');
|
88160
|
+
const modalNode = document.createElement('div');
|
88161
|
+
document.body.appendChild(modalNode);
|
88162
|
+
const vm = new (external_commonjs_vue_commonjs2_vue_root_Vue_default())({
|
88163
|
+
render: h => {
|
88164
|
+
return h(wei_rong_face_auth_dialog, {
|
88165
|
+
props: {},
|
88166
|
+
on: {
|
88167
|
+
close: data => {
|
88168
|
+
this.$emit('click', data);
|
88169
|
+
vm.$destroy();
|
88170
|
+
vm.$el.remove();
|
88171
|
+
}
|
88172
|
+
}
|
88173
|
+
});
|
88174
|
+
},
|
88175
|
+
parent: this
|
88176
|
+
}).$mount(modalNode);
|
88177
|
+
},
|
87627
88178
|
/** 良田拍照*/
|
87628
88179
|
readFacePhotoByELoam() {
|
87629
88180
|
const modalNode = document.createElement('div');
|
@@ -87696,11 +88247,11 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87696
88247
|
;
|
87697
88248
|
var id_card_reader_button_component = normalizeComponent(
|
87698
88249
|
src_id_card_reader_buttonvue_type_script_lang_js_,
|
87699
|
-
|
87700
|
-
|
88250
|
+
id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render,
|
88251
|
+
id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns,
|
87701
88252
|
false,
|
87702
88253
|
null,
|
87703
|
-
"
|
88254
|
+
"19ae37ba",
|
87704
88255
|
null
|
87705
88256
|
|
87706
88257
|
)
|