unify-external-plugin-platform 0.0.2-78 → 0.0.2-79
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 +346 -14
- package/dist/external-plugin.umd.js +346 -14
- package/dist/external-plugin.umd.min.js +3 -3
- package/package.json +1 -1
@@ -85377,7 +85377,7 @@ class WeiRongPluginService {
|
|
85377
85377
|
}
|
85378
85378
|
}
|
85379
85379
|
}
|
85380
|
-
_defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:
|
85380
|
+
_defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:58471');
|
85381
85381
|
_defineProperty(WeiRongPluginService, "ws", void 0);
|
85382
85382
|
_defineProperty(WeiRongPluginService, "requestStore", []);
|
85383
85383
|
_defineProperty(WeiRongPluginService, "timer", null);
|
@@ -85871,8 +85871,8 @@ id_card_reader_eloam.install = Vue => {
|
|
85871
85871
|
Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
|
85872
85872
|
};
|
85873
85873
|
/* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
|
85874
|
-
;// 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/id-card-reader-button.vue?vue&type=template&id=
|
85875
|
-
var
|
85874
|
+
;// 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/id-card-reader-button.vue?vue&type=template&id=19ae37ba&scoped=true&
|
85875
|
+
var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = function render() {
|
85876
85876
|
var _vm = this,
|
85877
85877
|
_c = _vm._self._c;
|
85878
85878
|
return _vm.tip ? _c('el-tooltip', {
|
@@ -85949,7 +85949,7 @@ var id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_render = func
|
|
85949
85949
|
}
|
85950
85950
|
})], 2);
|
85951
85951
|
};
|
85952
|
-
var
|
85952
|
+
var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns = [];
|
85953
85953
|
|
85954
85954
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
|
85955
85955
|
|
@@ -86221,6 +86221,338 @@ _defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chrome
|
|
86221
86221
|
_defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
|
86222
86222
|
_defineProperty(SignReadService, "ws", void 0);
|
86223
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
|
+
};
|
86287
|
+
ws.onclose = () => this.handleClose();
|
86288
|
+
ws.onerror = () => this.handleError();
|
86289
|
+
this.ws = ws;
|
86290
|
+
return onConnect;
|
86291
|
+
}
|
86292
|
+
static handleError() {
|
86293
|
+
for (const type in this.requestStore) {
|
86294
|
+
this.requestStore.forEach(({
|
86295
|
+
reject
|
86296
|
+
}) => {
|
86297
|
+
reject('handleError');
|
86298
|
+
});
|
86299
|
+
}
|
86300
|
+
throw Error('E窗通设备功能加载失败');
|
86301
|
+
}
|
86302
|
+
static handleClose() {
|
86303
|
+
for (const type in this.requestStore) {
|
86304
|
+
this.requestStore.forEach(({
|
86305
|
+
reject
|
86306
|
+
}) => {
|
86307
|
+
reject('close');
|
86308
|
+
});
|
86309
|
+
}
|
86310
|
+
}
|
86311
|
+
static handleMessage(msg) {
|
86312
|
+
let data = '';
|
86313
|
+
try {
|
86314
|
+
data = JSON.parse(msg.data);
|
86315
|
+
} catch (e) {
|
86316
|
+
data = '';
|
86317
|
+
}
|
86318
|
+
this.requestStore.forEach(({
|
86319
|
+
resolve
|
86320
|
+
}) => {
|
86321
|
+
resolve(data);
|
86322
|
+
});
|
86323
|
+
this.requestStore = [];
|
86324
|
+
this.ws.close();
|
86325
|
+
}
|
86326
|
+
static async read(method) {
|
86327
|
+
await this.startConnect(method);
|
86328
|
+
const methodDesc = EWindowPassMethodDesc[method];
|
86329
|
+
if (this.ws.readyState === 1) {
|
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);
|
86378
|
+
return new Promise((resolve, reject) => {
|
86379
|
+
if (!this.requestStore) {
|
86380
|
+
this.requestStore = [];
|
86381
|
+
}
|
86382
|
+
this.requestStore.push({
|
86383
|
+
resolve,
|
86384
|
+
reject
|
86385
|
+
});
|
86386
|
+
});
|
86387
|
+
} else {
|
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
|
+
};
|
86549
|
+
}
|
86550
|
+
}
|
86551
|
+
}
|
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", []);
|
86224
86556
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
|
86225
86557
|
|
86226
86558
|
|
@@ -87465,7 +87797,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
87465
87797
|
;// 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/id-card-reader-button.vue?vue&type=script&lang=js&
|
87466
87798
|
|
87467
87799
|
|
87468
|
-
|
87800
|
+
|
87469
87801
|
|
87470
87802
|
|
87471
87803
|
|
@@ -87613,8 +87945,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
87613
87945
|
case 1:
|
87614
87946
|
return this.readLSIDCard();
|
87615
87947
|
case 2:
|
87616
|
-
|
87617
|
-
|
87948
|
+
idcardInfo = await EWindowPassService.idCardRead();
|
87949
|
+
this.$emit('click', idcardInfo);
|
87618
87950
|
break;
|
87619
87951
|
case 3:
|
87620
87952
|
const data = await MRAdbReadService.idCardRead();
|
@@ -87664,8 +87996,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
87664
87996
|
break;
|
87665
87997
|
case 2:
|
87666
87998
|
{
|
87667
|
-
|
87668
|
-
|
87999
|
+
const data = await EWindowPassService.faceValidateWithIdCardRead();
|
88000
|
+
this.$emit('click', data);
|
87669
88001
|
break;
|
87670
88002
|
}
|
87671
88003
|
case 3:
|
@@ -87696,7 +88028,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
87696
88028
|
let idcardInfo;
|
87697
88029
|
switch (this.readMachineType) {
|
87698
88030
|
case 2:
|
87699
|
-
|
88031
|
+
idcardInfo = await EWindowPassService.socialSecurityCardRead();
|
87700
88032
|
break;
|
87701
88033
|
case 4:
|
87702
88034
|
idcardInfo = await HuzReadService.socialSecurityCardRead();
|
@@ -87723,7 +88055,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
87723
88055
|
userSignature = await SignReadService.read(PluginApiType.hwSign);
|
87724
88056
|
break;
|
87725
88057
|
case 2:
|
87726
|
-
|
88058
|
+
userSignature = await EWindowPassService.signNameRead();
|
87727
88059
|
break;
|
87728
88060
|
case 3:
|
87729
88061
|
// 捷宇
|
@@ -87872,11 +88204,11 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
87872
88204
|
;
|
87873
88205
|
var id_card_reader_button_component = normalizeComponent(
|
87874
88206
|
src_id_card_reader_buttonvue_type_script_lang_js_,
|
87875
|
-
|
87876
|
-
|
88207
|
+
id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render,
|
88208
|
+
id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns,
|
87877
88209
|
false,
|
87878
88210
|
null,
|
87879
|
-
"
|
88211
|
+
"19ae37ba",
|
87880
88212
|
null
|
87881
88213
|
|
87882
88214
|
)
|