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.
@@ -85387,7 +85387,7 @@ class WeiRongPluginService {
85387
85387
  }
85388
85388
  }
85389
85389
  }
85390
- _defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:5847');
85390
+ _defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:58471');
85391
85391
  _defineProperty(WeiRongPluginService, "ws", void 0);
85392
85392
  _defineProperty(WeiRongPluginService, "requestStore", []);
85393
85393
  _defineProperty(WeiRongPluginService, "timer", null);
@@ -85881,8 +85881,8 @@ id_card_reader_eloam.install = Vue => {
85881
85881
  Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
85882
85882
  };
85883
85883
  /* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
85884
- ;// 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=88636c88&scoped=true&
85885
- var id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_render = function render() {
85884
+ ;// 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&
85885
+ var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = function render() {
85886
85886
  var _vm = this,
85887
85887
  _c = _vm._self._c;
85888
85888
  return _vm.tip ? _c('el-tooltip', {
@@ -85959,7 +85959,7 @@ var id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_render = func
85959
85959
  }
85960
85960
  })], 2);
85961
85961
  };
85962
- var id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_staticRenderFns = [];
85962
+ var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns = [];
85963
85963
 
85964
85964
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
85965
85965
 
@@ -86231,6 +86231,338 @@ _defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chrome
86231
86231
  _defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
86232
86232
  _defineProperty(SignReadService, "ws", void 0);
86233
86233
  _defineProperty(SignReadService, "requestStore", []);
86234
+ ;// CONCATENATED MODULE: ./packages/service/external-plugins/ewp-plugin-socket.service.ts
86235
+
86236
+
86237
+ /**
86238
+ * 沃斯德人证交互终端
86239
+ * E窗通WEBSOCKET服务
86240
+ *
86241
+ * */
86242
+
86243
+ var EWindowPassMethodCode;
86244
+ (function (EWindowPassMethodCode) {
86245
+ /** 读取社保卡 */
86246
+ EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
86247
+ /** 获取签名*/
86248
+ EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
86249
+ /** 读取二代身份证 */
86250
+ EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
86251
+ /** 人证比对 */
86252
+ EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
86253
+ /** 获取指纹 */
86254
+ EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
86255
+ })(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
86256
+ const EWindowPassMethodDesc = {
86257
+ [EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
86258
+ [EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
86259
+ [EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
86260
+ [EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
86261
+ [EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
86262
+ };
86263
+ class EWindowPassService {
86264
+ static startConnect(method) {
86265
+ if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
86266
+ return this;
86267
+ }
86268
+ let webSocketUrl = '';
86269
+ switch (method) {
86270
+ case EWindowPassMethodCode.FingerPrint_Base64:
86271
+ webSocketUrl = this.fingerPrintBasWebSocketUrl;
86272
+ break;
86273
+ default:
86274
+ webSocketUrl = this.iReadCardBasWebSocketUrl;
86275
+ break;
86276
+ }
86277
+ const ws = new WebSocket(webSocketUrl);
86278
+ let resolved;
86279
+ const onConnect = new Promise(resolve => {
86280
+ resolved = resolve;
86281
+ });
86282
+ ws.onopen = () => {
86283
+ resolved(true);
86284
+ };
86285
+ ws.onmessage = event => {
86286
+ if (method === EWindowPassMethodCode.FingerPrint_Base64) {
86287
+ // 指纹后端返回的是string
86288
+ event = {
86289
+ ...event,
86290
+ data: JSON.stringify({
86291
+ fingerPrintInfo: event.data
86292
+ })
86293
+ };
86294
+ }
86295
+ this.handleMessage(event);
86296
+ };
86297
+ ws.onclose = () => this.handleClose();
86298
+ ws.onerror = () => this.handleError();
86299
+ this.ws = ws;
86300
+ return onConnect;
86301
+ }
86302
+ static handleError() {
86303
+ for (const type in this.requestStore) {
86304
+ this.requestStore.forEach(({
86305
+ reject
86306
+ }) => {
86307
+ reject('handleError');
86308
+ });
86309
+ }
86310
+ throw Error('E窗通设备功能加载失败');
86311
+ }
86312
+ static handleClose() {
86313
+ for (const type in this.requestStore) {
86314
+ this.requestStore.forEach(({
86315
+ reject
86316
+ }) => {
86317
+ reject('close');
86318
+ });
86319
+ }
86320
+ }
86321
+ static handleMessage(msg) {
86322
+ let data = '';
86323
+ try {
86324
+ data = JSON.parse(msg.data);
86325
+ } catch (e) {
86326
+ data = '';
86327
+ }
86328
+ this.requestStore.forEach(({
86329
+ resolve
86330
+ }) => {
86331
+ resolve(data);
86332
+ });
86333
+ this.requestStore = [];
86334
+ this.ws.close();
86335
+ }
86336
+ static async read(method) {
86337
+ await this.startConnect(method);
86338
+ const methodDesc = EWindowPassMethodDesc[method];
86339
+ if (this.ws.readyState === 1) {
86340
+ if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
86341
+ let jsonString;
86342
+ // outTimes:超时时间(秒)
86343
+ switch (method) {
86344
+ case EWindowPassMethodCode.ReadIDCard_Base64:
86345
+ // cardReader:0 读卡器-USB;1 读卡器-COM
86346
+ jsonString = JSON.stringify({
86347
+ method,
86348
+ args: {
86349
+ outTimes: 30,
86350
+ cardReader: 1
86351
+ }
86352
+ });
86353
+ break;
86354
+ case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
86355
+ // cardReader:0 读卡器-USB;1 读卡器-COM
86356
+ jsonString = JSON.stringify({
86357
+ method,
86358
+ args: {
86359
+ outTimes: 30,
86360
+ cardReader: 1,
86361
+ cameraType: 0
86362
+ }
86363
+ });
86364
+ break;
86365
+ case EWindowPassMethodCode.iReadCardBas:
86366
+ // icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
86367
+ jsonString = JSON.stringify({
86368
+ method,
86369
+ args: {
86370
+ icType: '1'
86371
+ }
86372
+ });
86373
+ break;
86374
+ case EWindowPassMethodCode.FingerPrint_Base64:
86375
+ // 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
86376
+ jsonString = 'getimgae,1,0,288,0';
86377
+ break;
86378
+ default:
86379
+ jsonString = JSON.stringify({
86380
+ method,
86381
+ args: {
86382
+ outTimes: 30
86383
+ }
86384
+ });
86385
+ break;
86386
+ }
86387
+ this.ws.send(jsonString);
86388
+ return new Promise((resolve, reject) => {
86389
+ if (!this.requestStore) {
86390
+ this.requestStore = [];
86391
+ }
86392
+ this.requestStore.push({
86393
+ resolve,
86394
+ reject
86395
+ });
86396
+ });
86397
+ } else {
86398
+ throw Error(methodDesc + '未准备完成');
86399
+ }
86400
+ }
86401
+ /**
86402
+ * 读取二代身份证
86403
+ * */
86404
+ static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
86405
+ const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
86406
+ console.log('读取二代身份证==>', readData);
86407
+ if (!readData) {
86408
+ throw Error('未匹配可用的E窗通读取设备');
86409
+ }
86410
+ if (readData.retVal !== 0) {
86411
+ throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86412
+ }
86413
+ const idInfo = readData.idInfo.data;
86414
+ const {
86415
+ name,
86416
+ sex,
86417
+ birthday,
86418
+ address,
86419
+ id_num,
86420
+ nations
86421
+ } = idInfo;
86422
+ const IDCardData = {
86423
+ info: {
86424
+ name,
86425
+ sex,
86426
+ birthday: birthday.replace('-', '').replace('-', ''),
86427
+ address,
86428
+ cardId: id_num,
86429
+ nation: nations
86430
+ },
86431
+ headImage: readData.idPhotoPicBase64
86432
+ };
86433
+ console.log('读取二代身份证结果==>', IDCardData);
86434
+ return IDCardData;
86435
+ }
86436
+ /**
86437
+ * 人证比对
86438
+ */
86439
+ static async faceValidateWithIdCardRead() {
86440
+ const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
86441
+ console.log('人证比对==>', readData);
86442
+ if (!readData) {
86443
+ throw Error('未匹配可用的E窗通读取设备');
86444
+ }
86445
+ if (readData.retVal !== 0) {
86446
+ throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86447
+ }
86448
+ const idInfo = readData.idInfo.data;
86449
+ const {
86450
+ name,
86451
+ sex,
86452
+ birth,
86453
+ address,
86454
+ idNo,
86455
+ nation
86456
+ } = idInfo;
86457
+ const IDCardData = {
86458
+ idCard: {
86459
+ info: {
86460
+ name,
86461
+ sex,
86462
+ birthday: birth.replace('-', '').replace('-', ''),
86463
+ address,
86464
+ cardId: idNo,
86465
+ nation
86466
+ },
86467
+ headImage: readData.idPhotoBase64
86468
+ },
86469
+ faceimg: readData.scenceBase64
86470
+ };
86471
+ console.log('人证比对结果==>', IDCardData);
86472
+ return IDCardData;
86473
+ }
86474
+ /** 读取社保卡 */
86475
+ static async socialSecurityCardRead() {
86476
+ const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
86477
+ if (!readData) {
86478
+ throw Error('未匹配可用的E窗通读取设备');
86479
+ }
86480
+ if (readData.retVal !== 0) {
86481
+ throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
86482
+ }
86483
+ // 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
86484
+ const outInfo = readData.outInfo;
86485
+ const outInfoArray = outInfo.split('|');
86486
+ const cardId = outInfoArray[1];
86487
+ const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
86488
+ const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
86489
+ const IDCardData = {
86490
+ info: {
86491
+ name: outInfoArray[4],
86492
+ sex,
86493
+ birthday,
86494
+ address: '',
86495
+ cardId
86496
+ },
86497
+ headImage: ''
86498
+ };
86499
+ console.log('读取社保卡==>', readData);
86500
+ return IDCardData;
86501
+ }
86502
+ /** 获取签名-base64 */
86503
+ static async signNameRead() {
86504
+ const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
86505
+ if (!readData) {
86506
+ throw Error('未匹配可用的E窗通读取设备');
86507
+ }
86508
+ if (readData.retVal !== 0) {
86509
+ throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86510
+ }
86511
+ console.log('获取签名==>', readData);
86512
+ return readData.signPicBase64;
86513
+ }
86514
+ /** 获取指纹*/
86515
+ static async fingerPrintRead() {
86516
+ let timeOver = 30;
86517
+ async function readFingerPrint() {
86518
+ const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
86519
+ if (!readData) {
86520
+ throw Error('未匹配可用的E窗通读取设备');
86521
+ }
86522
+ let list = readData.fingerPrintInfo.split("|");
86523
+ console.log(list);
86524
+ let ret = Number(list[1]);
86525
+ if (ret > 1) {
86526
+ if (timeOver > 0) {
86527
+ timeOver--;
86528
+ return await readFingerPrint();
86529
+ } else {
86530
+ return {
86531
+ status: 'error',
86532
+ data: '已超时,请重新操作,按压指纹'
86533
+ };
86534
+ }
86535
+ } else {
86536
+ return {
86537
+ status: 'success',
86538
+ data: readData.fingerPrintInfo
86539
+ };
86540
+ }
86541
+ }
86542
+ let {
86543
+ status,
86544
+ data
86545
+ } = await readFingerPrint();
86546
+ if (status === 'error') {
86547
+ throw Error(data);
86548
+ } else {
86549
+ let [method, result, quality, image, featureCode] = data.split('|');
86550
+ // getimgae|1|68|......|......
86551
+ // method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
86552
+ return {
86553
+ method,
86554
+ result,
86555
+ quality,
86556
+ image,
86557
+ featureCode
86558
+ };
86559
+ }
86560
+ }
86561
+ }
86562
+ _defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
86563
+ _defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
86564
+ _defineProperty(EWindowPassService, "ws", void 0);
86565
+ _defineProperty(EWindowPassService, "requestStore", []);
86234
86566
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
86235
86567
 
86236
86568
 
@@ -87475,7 +87807,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87475
87807
  ;// 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&
87476
87808
 
87477
87809
 
87478
- // import { EWindowPassService } from '../../../service/external-plugins/ewp-plugin-socket.service'
87810
+
87479
87811
 
87480
87812
 
87481
87813
 
@@ -87623,8 +87955,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87623
87955
  case 1:
87624
87956
  return this.readLSIDCard();
87625
87957
  case 2:
87626
- // idcardInfo = await EWindowPassService.idCardRead()
87627
- // this.$emit('click', idcardInfo)
87958
+ idcardInfo = await EWindowPassService.idCardRead();
87959
+ this.$emit('click', idcardInfo);
87628
87960
  break;
87629
87961
  case 3:
87630
87962
  const data = await MRAdbReadService.idCardRead();
@@ -87674,8 +88006,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87674
88006
  break;
87675
88007
  case 2:
87676
88008
  {
87677
- // const data = await EWindowPassService.faceValidateWithIdCardRead()
87678
- // this.$emit('click', data)
88009
+ const data = await EWindowPassService.faceValidateWithIdCardRead();
88010
+ this.$emit('click', data);
87679
88011
  break;
87680
88012
  }
87681
88013
  case 3:
@@ -87706,7 +88038,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87706
88038
  let idcardInfo;
87707
88039
  switch (this.readMachineType) {
87708
88040
  case 2:
87709
- // idcardInfo = await EWindowPassService.socialSecurityCardRead()
88041
+ idcardInfo = await EWindowPassService.socialSecurityCardRead();
87710
88042
  break;
87711
88043
  case 4:
87712
88044
  idcardInfo = await HuzReadService.socialSecurityCardRead();
@@ -87733,7 +88065,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87733
88065
  userSignature = await SignReadService.read(PluginApiType.hwSign);
87734
88066
  break;
87735
88067
  case 2:
87736
- // userSignature = await EWindowPassService.signNameRead()
88068
+ userSignature = await EWindowPassService.signNameRead();
87737
88069
  break;
87738
88070
  case 3:
87739
88071
  // 捷宇
@@ -87882,11 +88214,11 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87882
88214
  ;
87883
88215
  var id_card_reader_button_component = normalizeComponent(
87884
88216
  src_id_card_reader_buttonvue_type_script_lang_js_,
87885
- id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_render,
87886
- id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_staticRenderFns,
88217
+ id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render,
88218
+ id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns,
87887
88219
  false,
87888
88220
  null,
87889
- "88636c88",
88221
+ "19ae37ba",
87890
88222
  null
87891
88223
 
87892
88224
  )