unify-external-plugin-platform 0.0.2-77 → 0.0.2-78

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.
@@ -85007,12 +85007,12 @@ _defineProperty(UdsPluginSocketService, "requestStore", []);
85007
85007
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/wei-rong-plugin-socket.service.ts
85008
85008
 
85009
85009
 
85010
+
85010
85011
  /**
85011
85012
  * @author: lvcy
85012
85013
  * @date: 2024-03-22
85013
85014
  * @description:国产客户端,硬件对接
85014
85015
  */
85015
-
85016
85016
  var WEIRONGMethodCode;
85017
85017
  (function (WEIRONGMethodCode) {
85018
85018
  /** 读卡 */
@@ -85032,18 +85032,16 @@ var WEIRONGMethodCode;
85032
85032
  })(WEIRONGMethodCode || (WEIRONGMethodCode = {}));
85033
85033
  const WEIRONGMethodDesc = {
85034
85034
  [WEIRONGMethodCode.ReadCard_Base64]: '读卡',
85035
- [WEIRONGMethodCode.StartSignName]: '开始签名',
85036
- [WEIRONGMethodCode.GetSignNameStatus]: '获取签名状态',
85037
85035
  [WEIRONGMethodCode.GetSignName_Base64]: '获取签名',
85038
- [WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
85039
- [WEIRONGMethodCode.TurnOnTheCamera]: '打开高拍仪',
85040
- [WEIRONGMethodCode.ScannerCamera]: '拍照'
85036
+ [WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对'
85041
85037
  };
85042
85038
  class WeiRongPluginService {
85043
85039
  static startConnect(method) {
85040
+ console.log('startConnect', method, this.ws?.readyState, WebSocket.CONNECTING);
85044
85041
  if (this.ws && this.ws.readyState === WebSocket.OPEN) {
85045
85042
  return this;
85046
85043
  }
85044
+ console.log('重新链接');
85047
85045
  const ws = new WebSocket(this.webSocketUrl);
85048
85046
  let resolved;
85049
85047
  const onConnect = new Promise(resolve => {
@@ -85080,15 +85078,15 @@ class WeiRongPluginService {
85080
85078
  }
85081
85079
  }
85082
85080
  static handleMessage(msg) {
85083
- let data = {};
85081
+ let data = '';
85084
85082
  try {
85085
85083
  data = JSON.parse(msg.data);
85086
85084
  } catch (e) {
85087
- data = {};
85085
+ data = '';
85088
85086
  }
85089
85087
  if (data.method === 'FaceScreenStream' || data.method === 'VideoStream') {
85090
85088
  const event = new ScannerCameraRefreshPhotoEvent(data.imgBase64);
85091
- window.dispatchEvent(event);
85089
+ return window.dispatchEvent(event);
85092
85090
  } else {
85093
85091
  this.requestStore.forEach(({
85094
85092
  resolve
@@ -85177,7 +85175,7 @@ class WeiRongPluginService {
85177
85175
  if (!readData) {
85178
85176
  throw Error('未匹配到可用的读取设备');
85179
85177
  }
85180
- if (readData.retVal != 0) {
85178
+ if (readData.retVal !== 0) {
85181
85179
  this.ws?.close();
85182
85180
  throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
85183
85181
  }
@@ -85342,11 +85340,10 @@ class WeiRongPluginService {
85342
85340
  return IDCardData;
85343
85341
  } else {
85344
85342
  this.ws?.close();
85345
- throw new Error('人证对比失败');
85346
85343
  }
85347
85344
  }
85348
85345
  /** 签字*/
85349
- static signNameRead() {
85346
+ static async signNameRead() {
85350
85347
  return new Promise(async (resolve, reject) => {
85351
85348
  const readData = await WeiRongPluginService.read(WEIRONGMethodCode.StartSignName);
85352
85349
  console.log('开始签名=>', readData);
@@ -85387,9 +85384,6 @@ class WeiRongPluginService {
85387
85384
  if (res.method === 'GetCameraImage' && res.retVal == 0) {
85388
85385
  this.ws?.close();
85389
85386
  return res.cameraImgBase64;
85390
- } else {
85391
- this.ws?.close();
85392
- throw new Error('拍照失败');
85393
85387
  }
85394
85388
  }
85395
85389
  }
@@ -85887,8 +85881,8 @@ id_card_reader_eloam.install = Vue => {
85887
85881
  Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
85888
85882
  };
85889
85883
  /* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
85890
- ;// 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&
85891
- var id_card_reader_buttonvue_type_template_id_19ae37ba_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=88636c88&scoped=true&
85885
+ var id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_render = function render() {
85892
85886
  var _vm = this,
85893
85887
  _c = _vm._self._c;
85894
85888
  return _vm.tip ? _c('el-tooltip', {
@@ -85965,7 +85959,7 @@ var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = func
85965
85959
  }
85966
85960
  })], 2);
85967
85961
  };
85968
- var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns = [];
85962
+ var id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_staticRenderFns = [];
85969
85963
 
85970
85964
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
85971
85965
 
@@ -86237,338 +86231,6 @@ _defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chrome
86237
86231
  _defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
86238
86232
  _defineProperty(SignReadService, "ws", void 0);
86239
86233
  _defineProperty(SignReadService, "requestStore", []);
86240
- ;// CONCATENATED MODULE: ./packages/service/external-plugins/ewp-plugin-socket.service.ts
86241
-
86242
-
86243
- /**
86244
- * 沃斯德人证交互终端
86245
- * E窗通WEBSOCKET服务
86246
- *
86247
- * */
86248
-
86249
- var EWindowPassMethodCode;
86250
- (function (EWindowPassMethodCode) {
86251
- /** 读取社保卡 */
86252
- EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
86253
- /** 获取签名*/
86254
- EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
86255
- /** 读取二代身份证 */
86256
- EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
86257
- /** 人证比对 */
86258
- EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
86259
- /** 获取指纹 */
86260
- EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
86261
- })(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
86262
- const EWindowPassMethodDesc = {
86263
- [EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
86264
- [EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
86265
- [EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
86266
- [EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
86267
- [EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
86268
- };
86269
- class EWindowPassService {
86270
- static startConnect(method) {
86271
- if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
86272
- return this;
86273
- }
86274
- let webSocketUrl = '';
86275
- switch (method) {
86276
- case EWindowPassMethodCode.FingerPrint_Base64:
86277
- webSocketUrl = this.fingerPrintBasWebSocketUrl;
86278
- break;
86279
- default:
86280
- webSocketUrl = this.iReadCardBasWebSocketUrl;
86281
- break;
86282
- }
86283
- const ws = new WebSocket(webSocketUrl);
86284
- let resolved;
86285
- const onConnect = new Promise(resolve => {
86286
- resolved = resolve;
86287
- });
86288
- ws.onopen = () => {
86289
- resolved(true);
86290
- };
86291
- ws.onmessage = event => {
86292
- if (method === EWindowPassMethodCode.FingerPrint_Base64) {
86293
- // 指纹后端返回的是string
86294
- event = {
86295
- ...event,
86296
- data: JSON.stringify({
86297
- fingerPrintInfo: event.data
86298
- })
86299
- };
86300
- }
86301
- this.handleMessage(event);
86302
- };
86303
- ws.onclose = () => this.handleClose();
86304
- ws.onerror = () => this.handleError();
86305
- this.ws = ws;
86306
- return onConnect;
86307
- }
86308
- static handleError() {
86309
- for (const type in this.requestStore) {
86310
- this.requestStore.forEach(({
86311
- reject
86312
- }) => {
86313
- reject('handleError');
86314
- });
86315
- }
86316
- throw Error('E窗通设备功能加载失败');
86317
- }
86318
- static handleClose() {
86319
- for (const type in this.requestStore) {
86320
- this.requestStore.forEach(({
86321
- reject
86322
- }) => {
86323
- reject('close');
86324
- });
86325
- }
86326
- }
86327
- static handleMessage(msg) {
86328
- let data = '';
86329
- try {
86330
- data = JSON.parse(msg.data);
86331
- } catch (e) {
86332
- data = '';
86333
- }
86334
- this.requestStore.forEach(({
86335
- resolve
86336
- }) => {
86337
- resolve(data);
86338
- });
86339
- this.requestStore = [];
86340
- this.ws.close();
86341
- }
86342
- static async read(method) {
86343
- await this.startConnect(method);
86344
- const methodDesc = EWindowPassMethodDesc[method];
86345
- if (this.ws.readyState === 1) {
86346
- if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
86347
- let jsonString;
86348
- // outTimes:超时时间(秒)
86349
- switch (method) {
86350
- case EWindowPassMethodCode.ReadIDCard_Base64:
86351
- // cardReader:0 读卡器-USB;1 读卡器-COM
86352
- jsonString = JSON.stringify({
86353
- method,
86354
- args: {
86355
- outTimes: 30,
86356
- cardReader: 1
86357
- }
86358
- });
86359
- break;
86360
- case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
86361
- // cardReader:0 读卡器-USB;1 读卡器-COM
86362
- jsonString = JSON.stringify({
86363
- method,
86364
- args: {
86365
- outTimes: 30,
86366
- cardReader: 1,
86367
- cameraType: 0
86368
- }
86369
- });
86370
- break;
86371
- case EWindowPassMethodCode.iReadCardBas:
86372
- // icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
86373
- jsonString = JSON.stringify({
86374
- method,
86375
- args: {
86376
- icType: '1'
86377
- }
86378
- });
86379
- break;
86380
- case EWindowPassMethodCode.FingerPrint_Base64:
86381
- // 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
86382
- jsonString = 'getimgae,1,0,288,0';
86383
- break;
86384
- default:
86385
- jsonString = JSON.stringify({
86386
- method,
86387
- args: {
86388
- outTimes: 30
86389
- }
86390
- });
86391
- break;
86392
- }
86393
- this.ws.send(jsonString);
86394
- return new Promise((resolve, reject) => {
86395
- if (!this.requestStore) {
86396
- this.requestStore = [];
86397
- }
86398
- this.requestStore.push({
86399
- resolve,
86400
- reject
86401
- });
86402
- });
86403
- } else {
86404
- throw Error(methodDesc + '未准备完成');
86405
- }
86406
- }
86407
- /**
86408
- * 读取二代身份证
86409
- * */
86410
- static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
86411
- const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
86412
- console.log('读取二代身份证==>', readData);
86413
- if (!readData) {
86414
- throw Error('未匹配可用的E窗通读取设备');
86415
- }
86416
- if (readData.retVal !== 0) {
86417
- throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86418
- }
86419
- const idInfo = readData.idInfo.data;
86420
- const {
86421
- name,
86422
- sex,
86423
- birthday,
86424
- address,
86425
- id_num,
86426
- nations
86427
- } = idInfo;
86428
- const IDCardData = {
86429
- info: {
86430
- name,
86431
- sex,
86432
- birthday: birthday.replace('-', '').replace('-', ''),
86433
- address,
86434
- cardId: id_num,
86435
- nation: nations
86436
- },
86437
- headImage: readData.idPhotoPicBase64
86438
- };
86439
- console.log('读取二代身份证结果==>', IDCardData);
86440
- return IDCardData;
86441
- }
86442
- /**
86443
- * 人证比对
86444
- */
86445
- static async faceValidateWithIdCardRead() {
86446
- const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
86447
- console.log('人证比对==>', readData);
86448
- if (!readData) {
86449
- throw Error('未匹配可用的E窗通读取设备');
86450
- }
86451
- if (readData.retVal !== 0) {
86452
- throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86453
- }
86454
- const idInfo = readData.idInfo.data;
86455
- const {
86456
- name,
86457
- sex,
86458
- birth,
86459
- address,
86460
- idNo,
86461
- nation
86462
- } = idInfo;
86463
- const IDCardData = {
86464
- idCard: {
86465
- info: {
86466
- name,
86467
- sex,
86468
- birthday: birth.replace('-', '').replace('-', ''),
86469
- address,
86470
- cardId: idNo,
86471
- nation
86472
- },
86473
- headImage: readData.idPhotoBase64
86474
- },
86475
- faceimg: readData.scenceBase64
86476
- };
86477
- console.log('人证比对结果==>', IDCardData);
86478
- return IDCardData;
86479
- }
86480
- /** 读取社保卡 */
86481
- static async socialSecurityCardRead() {
86482
- const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
86483
- if (!readData) {
86484
- throw Error('未匹配可用的E窗通读取设备');
86485
- }
86486
- if (readData.retVal !== 0) {
86487
- throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
86488
- }
86489
- // 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
86490
- const outInfo = readData.outInfo;
86491
- const outInfoArray = outInfo.split('|');
86492
- const cardId = outInfoArray[1];
86493
- const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
86494
- const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
86495
- const IDCardData = {
86496
- info: {
86497
- name: outInfoArray[4],
86498
- sex,
86499
- birthday,
86500
- address: '',
86501
- cardId
86502
- },
86503
- headImage: ''
86504
- };
86505
- console.log('读取社保卡==>', readData);
86506
- return IDCardData;
86507
- }
86508
- /** 获取签名-base64 */
86509
- static async signNameRead() {
86510
- const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
86511
- if (!readData) {
86512
- throw Error('未匹配可用的E窗通读取设备');
86513
- }
86514
- if (readData.retVal !== 0) {
86515
- throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86516
- }
86517
- console.log('获取签名==>', readData);
86518
- return readData.signPicBase64;
86519
- }
86520
- /** 获取指纹*/
86521
- static async fingerPrintRead() {
86522
- let timeOver = 30;
86523
- async function readFingerPrint() {
86524
- const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
86525
- if (!readData) {
86526
- throw Error('未匹配可用的E窗通读取设备');
86527
- }
86528
- let list = readData.fingerPrintInfo.split("|");
86529
- console.log(list);
86530
- let ret = Number(list[1]);
86531
- if (ret > 1) {
86532
- if (timeOver > 0) {
86533
- timeOver--;
86534
- return await readFingerPrint();
86535
- } else {
86536
- return {
86537
- status: 'error',
86538
- data: '已超时,请重新操作,按压指纹'
86539
- };
86540
- }
86541
- } else {
86542
- return {
86543
- status: 'success',
86544
- data: readData.fingerPrintInfo
86545
- };
86546
- }
86547
- }
86548
- let {
86549
- status,
86550
- data
86551
- } = await readFingerPrint();
86552
- if (status === 'error') {
86553
- throw Error(data);
86554
- } else {
86555
- let [method, result, quality, image, featureCode] = data.split('|');
86556
- // getimgae|1|68|......|......
86557
- // method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
86558
- return {
86559
- method,
86560
- result,
86561
- quality,
86562
- image,
86563
- featureCode
86564
- };
86565
- }
86566
- }
86567
- }
86568
- _defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
86569
- _defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
86570
- _defineProperty(EWindowPassService, "ws", void 0);
86571
- _defineProperty(EWindowPassService, "requestStore", []);
86572
86234
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
86573
86235
 
86574
86236
 
@@ -87813,7 +87475,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87813
87475
  ;// 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&
87814
87476
 
87815
87477
 
87816
-
87478
+ // import { EWindowPassService } from '../../../service/external-plugins/ewp-plugin-socket.service'
87817
87479
 
87818
87480
 
87819
87481
 
@@ -87961,8 +87623,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87961
87623
  case 1:
87962
87624
  return this.readLSIDCard();
87963
87625
  case 2:
87964
- idcardInfo = await EWindowPassService.idCardRead();
87965
- this.$emit('click', idcardInfo);
87626
+ // idcardInfo = await EWindowPassService.idCardRead()
87627
+ // this.$emit('click', idcardInfo)
87966
87628
  break;
87967
87629
  case 3:
87968
87630
  const data = await MRAdbReadService.idCardRead();
@@ -88012,8 +87674,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88012
87674
  break;
88013
87675
  case 2:
88014
87676
  {
88015
- const data = await EWindowPassService.faceValidateWithIdCardRead();
88016
- this.$emit('click', data);
87677
+ // const data = await EWindowPassService.faceValidateWithIdCardRead()
87678
+ // this.$emit('click', data)
88017
87679
  break;
88018
87680
  }
88019
87681
  case 3:
@@ -88044,7 +87706,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88044
87706
  let idcardInfo;
88045
87707
  switch (this.readMachineType) {
88046
87708
  case 2:
88047
- idcardInfo = await EWindowPassService.socialSecurityCardRead();
87709
+ // idcardInfo = await EWindowPassService.socialSecurityCardRead()
88048
87710
  break;
88049
87711
  case 4:
88050
87712
  idcardInfo = await HuzReadService.socialSecurityCardRead();
@@ -88071,7 +87733,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88071
87733
  userSignature = await SignReadService.read(PluginApiType.hwSign);
88072
87734
  break;
88073
87735
  case 2:
88074
- userSignature = await EWindowPassService.signNameRead();
87736
+ // userSignature = await EWindowPassService.signNameRead()
88075
87737
  break;
88076
87738
  case 3:
88077
87739
  // 捷宇
@@ -88220,11 +87882,11 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88220
87882
  ;
88221
87883
  var id_card_reader_button_component = normalizeComponent(
88222
87884
  src_id_card_reader_buttonvue_type_script_lang_js_,
88223
- id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render,
88224
- id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns,
87885
+ id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_render,
87886
+ id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_staticRenderFns,
88225
87887
  false,
88226
87888
  null,
88227
- "19ae37ba",
87889
+ "88636c88",
88228
87890
  null
88229
87891
 
88230
87892
  )