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.
@@ -84997,12 +84997,12 @@ _defineProperty(UdsPluginSocketService, "requestStore", []);
84997
84997
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/wei-rong-plugin-socket.service.ts
84998
84998
 
84999
84999
 
85000
+
85000
85001
  /**
85001
85002
  * @author: lvcy
85002
85003
  * @date: 2024-03-22
85003
85004
  * @description:国产客户端,硬件对接
85004
85005
  */
85005
-
85006
85006
  var WEIRONGMethodCode;
85007
85007
  (function (WEIRONGMethodCode) {
85008
85008
  /** 读卡 */
@@ -85022,18 +85022,16 @@ var WEIRONGMethodCode;
85022
85022
  })(WEIRONGMethodCode || (WEIRONGMethodCode = {}));
85023
85023
  const WEIRONGMethodDesc = {
85024
85024
  [WEIRONGMethodCode.ReadCard_Base64]: '读卡',
85025
- [WEIRONGMethodCode.StartSignName]: '开始签名',
85026
- [WEIRONGMethodCode.GetSignNameStatus]: '获取签名状态',
85027
85025
  [WEIRONGMethodCode.GetSignName_Base64]: '获取签名',
85028
- [WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
85029
- [WEIRONGMethodCode.TurnOnTheCamera]: '打开高拍仪',
85030
- [WEIRONGMethodCode.ScannerCamera]: '拍照'
85026
+ [WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对'
85031
85027
  };
85032
85028
  class WeiRongPluginService {
85033
85029
  static startConnect(method) {
85030
+ console.log('startConnect', method, this.ws?.readyState, WebSocket.CONNECTING);
85034
85031
  if (this.ws && this.ws.readyState === WebSocket.OPEN) {
85035
85032
  return this;
85036
85033
  }
85034
+ console.log('重新链接');
85037
85035
  const ws = new WebSocket(this.webSocketUrl);
85038
85036
  let resolved;
85039
85037
  const onConnect = new Promise(resolve => {
@@ -85070,15 +85068,15 @@ class WeiRongPluginService {
85070
85068
  }
85071
85069
  }
85072
85070
  static handleMessage(msg) {
85073
- let data = {};
85071
+ let data = '';
85074
85072
  try {
85075
85073
  data = JSON.parse(msg.data);
85076
85074
  } catch (e) {
85077
- data = {};
85075
+ data = '';
85078
85076
  }
85079
85077
  if (data.method === 'FaceScreenStream' || data.method === 'VideoStream') {
85080
85078
  const event = new ScannerCameraRefreshPhotoEvent(data.imgBase64);
85081
- window.dispatchEvent(event);
85079
+ return window.dispatchEvent(event);
85082
85080
  } else {
85083
85081
  this.requestStore.forEach(({
85084
85082
  resolve
@@ -85167,7 +85165,7 @@ class WeiRongPluginService {
85167
85165
  if (!readData) {
85168
85166
  throw Error('未匹配到可用的读取设备');
85169
85167
  }
85170
- if (readData.retVal != 0) {
85168
+ if (readData.retVal !== 0) {
85171
85169
  this.ws?.close();
85172
85170
  throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
85173
85171
  }
@@ -85332,11 +85330,10 @@ class WeiRongPluginService {
85332
85330
  return IDCardData;
85333
85331
  } else {
85334
85332
  this.ws?.close();
85335
- throw new Error('人证对比失败');
85336
85333
  }
85337
85334
  }
85338
85335
  /** 签字*/
85339
- static signNameRead() {
85336
+ static async signNameRead() {
85340
85337
  return new Promise(async (resolve, reject) => {
85341
85338
  const readData = await WeiRongPluginService.read(WEIRONGMethodCode.StartSignName);
85342
85339
  console.log('开始签名=>', readData);
@@ -85377,9 +85374,6 @@ class WeiRongPluginService {
85377
85374
  if (res.method === 'GetCameraImage' && res.retVal == 0) {
85378
85375
  this.ws?.close();
85379
85376
  return res.cameraImgBase64;
85380
- } else {
85381
- this.ws?.close();
85382
- throw new Error('拍照失败');
85383
85377
  }
85384
85378
  }
85385
85379
  }
@@ -85877,8 +85871,8 @@ id_card_reader_eloam.install = Vue => {
85877
85871
  Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
85878
85872
  };
85879
85873
  /* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
85880
- ;// 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&
85881
- var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = function render() {
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=88636c88&scoped=true&
85875
+ var id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_render = function render() {
85882
85876
  var _vm = this,
85883
85877
  _c = _vm._self._c;
85884
85878
  return _vm.tip ? _c('el-tooltip', {
@@ -85955,7 +85949,7 @@ var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = func
85955
85949
  }
85956
85950
  })], 2);
85957
85951
  };
85958
- var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns = [];
85952
+ var id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_staticRenderFns = [];
85959
85953
 
85960
85954
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
85961
85955
 
@@ -86227,338 +86221,6 @@ _defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chrome
86227
86221
  _defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
86228
86222
  _defineProperty(SignReadService, "ws", void 0);
86229
86223
  _defineProperty(SignReadService, "requestStore", []);
86230
- ;// CONCATENATED MODULE: ./packages/service/external-plugins/ewp-plugin-socket.service.ts
86231
-
86232
-
86233
- /**
86234
- * 沃斯德人证交互终端
86235
- * E窗通WEBSOCKET服务
86236
- *
86237
- * */
86238
-
86239
- var EWindowPassMethodCode;
86240
- (function (EWindowPassMethodCode) {
86241
- /** 读取社保卡 */
86242
- EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
86243
- /** 获取签名*/
86244
- EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
86245
- /** 读取二代身份证 */
86246
- EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
86247
- /** 人证比对 */
86248
- EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
86249
- /** 获取指纹 */
86250
- EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
86251
- })(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
86252
- const EWindowPassMethodDesc = {
86253
- [EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
86254
- [EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
86255
- [EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
86256
- [EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
86257
- [EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
86258
- };
86259
- class EWindowPassService {
86260
- static startConnect(method) {
86261
- if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
86262
- return this;
86263
- }
86264
- let webSocketUrl = '';
86265
- switch (method) {
86266
- case EWindowPassMethodCode.FingerPrint_Base64:
86267
- webSocketUrl = this.fingerPrintBasWebSocketUrl;
86268
- break;
86269
- default:
86270
- webSocketUrl = this.iReadCardBasWebSocketUrl;
86271
- break;
86272
- }
86273
- const ws = new WebSocket(webSocketUrl);
86274
- let resolved;
86275
- const onConnect = new Promise(resolve => {
86276
- resolved = resolve;
86277
- });
86278
- ws.onopen = () => {
86279
- resolved(true);
86280
- };
86281
- ws.onmessage = event => {
86282
- if (method === EWindowPassMethodCode.FingerPrint_Base64) {
86283
- // 指纹后端返回的是string
86284
- event = {
86285
- ...event,
86286
- data: JSON.stringify({
86287
- fingerPrintInfo: event.data
86288
- })
86289
- };
86290
- }
86291
- this.handleMessage(event);
86292
- };
86293
- ws.onclose = () => this.handleClose();
86294
- ws.onerror = () => this.handleError();
86295
- this.ws = ws;
86296
- return onConnect;
86297
- }
86298
- static handleError() {
86299
- for (const type in this.requestStore) {
86300
- this.requestStore.forEach(({
86301
- reject
86302
- }) => {
86303
- reject('handleError');
86304
- });
86305
- }
86306
- throw Error('E窗通设备功能加载失败');
86307
- }
86308
- static handleClose() {
86309
- for (const type in this.requestStore) {
86310
- this.requestStore.forEach(({
86311
- reject
86312
- }) => {
86313
- reject('close');
86314
- });
86315
- }
86316
- }
86317
- static handleMessage(msg) {
86318
- let data = '';
86319
- try {
86320
- data = JSON.parse(msg.data);
86321
- } catch (e) {
86322
- data = '';
86323
- }
86324
- this.requestStore.forEach(({
86325
- resolve
86326
- }) => {
86327
- resolve(data);
86328
- });
86329
- this.requestStore = [];
86330
- this.ws.close();
86331
- }
86332
- static async read(method) {
86333
- await this.startConnect(method);
86334
- const methodDesc = EWindowPassMethodDesc[method];
86335
- if (this.ws.readyState === 1) {
86336
- if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
86337
- let jsonString;
86338
- // outTimes:超时时间(秒)
86339
- switch (method) {
86340
- case EWindowPassMethodCode.ReadIDCard_Base64:
86341
- // cardReader:0 读卡器-USB;1 读卡器-COM
86342
- jsonString = JSON.stringify({
86343
- method,
86344
- args: {
86345
- outTimes: 30,
86346
- cardReader: 1
86347
- }
86348
- });
86349
- break;
86350
- case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
86351
- // cardReader:0 读卡器-USB;1 读卡器-COM
86352
- jsonString = JSON.stringify({
86353
- method,
86354
- args: {
86355
- outTimes: 30,
86356
- cardReader: 1,
86357
- cameraType: 0
86358
- }
86359
- });
86360
- break;
86361
- case EWindowPassMethodCode.iReadCardBas:
86362
- // icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
86363
- jsonString = JSON.stringify({
86364
- method,
86365
- args: {
86366
- icType: '1'
86367
- }
86368
- });
86369
- break;
86370
- case EWindowPassMethodCode.FingerPrint_Base64:
86371
- // 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
86372
- jsonString = 'getimgae,1,0,288,0';
86373
- break;
86374
- default:
86375
- jsonString = JSON.stringify({
86376
- method,
86377
- args: {
86378
- outTimes: 30
86379
- }
86380
- });
86381
- break;
86382
- }
86383
- this.ws.send(jsonString);
86384
- return new Promise((resolve, reject) => {
86385
- if (!this.requestStore) {
86386
- this.requestStore = [];
86387
- }
86388
- this.requestStore.push({
86389
- resolve,
86390
- reject
86391
- });
86392
- });
86393
- } else {
86394
- throw Error(methodDesc + '未准备完成');
86395
- }
86396
- }
86397
- /**
86398
- * 读取二代身份证
86399
- * */
86400
- static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
86401
- const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
86402
- console.log('读取二代身份证==>', readData);
86403
- if (!readData) {
86404
- throw Error('未匹配可用的E窗通读取设备');
86405
- }
86406
- if (readData.retVal !== 0) {
86407
- throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86408
- }
86409
- const idInfo = readData.idInfo.data;
86410
- const {
86411
- name,
86412
- sex,
86413
- birthday,
86414
- address,
86415
- id_num,
86416
- nations
86417
- } = idInfo;
86418
- const IDCardData = {
86419
- info: {
86420
- name,
86421
- sex,
86422
- birthday: birthday.replace('-', '').replace('-', ''),
86423
- address,
86424
- cardId: id_num,
86425
- nation: nations
86426
- },
86427
- headImage: readData.idPhotoPicBase64
86428
- };
86429
- console.log('读取二代身份证结果==>', IDCardData);
86430
- return IDCardData;
86431
- }
86432
- /**
86433
- * 人证比对
86434
- */
86435
- static async faceValidateWithIdCardRead() {
86436
- const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
86437
- console.log('人证比对==>', readData);
86438
- if (!readData) {
86439
- throw Error('未匹配可用的E窗通读取设备');
86440
- }
86441
- if (readData.retVal !== 0) {
86442
- throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86443
- }
86444
- const idInfo = readData.idInfo.data;
86445
- const {
86446
- name,
86447
- sex,
86448
- birth,
86449
- address,
86450
- idNo,
86451
- nation
86452
- } = idInfo;
86453
- const IDCardData = {
86454
- idCard: {
86455
- info: {
86456
- name,
86457
- sex,
86458
- birthday: birth.replace('-', '').replace('-', ''),
86459
- address,
86460
- cardId: idNo,
86461
- nation
86462
- },
86463
- headImage: readData.idPhotoBase64
86464
- },
86465
- faceimg: readData.scenceBase64
86466
- };
86467
- console.log('人证比对结果==>', IDCardData);
86468
- return IDCardData;
86469
- }
86470
- /** 读取社保卡 */
86471
- static async socialSecurityCardRead() {
86472
- const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
86473
- if (!readData) {
86474
- throw Error('未匹配可用的E窗通读取设备');
86475
- }
86476
- if (readData.retVal !== 0) {
86477
- throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
86478
- }
86479
- // 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
86480
- const outInfo = readData.outInfo;
86481
- const outInfoArray = outInfo.split('|');
86482
- const cardId = outInfoArray[1];
86483
- const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
86484
- const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
86485
- const IDCardData = {
86486
- info: {
86487
- name: outInfoArray[4],
86488
- sex,
86489
- birthday,
86490
- address: '',
86491
- cardId
86492
- },
86493
- headImage: ''
86494
- };
86495
- console.log('读取社保卡==>', readData);
86496
- return IDCardData;
86497
- }
86498
- /** 获取签名-base64 */
86499
- static async signNameRead() {
86500
- const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
86501
- if (!readData) {
86502
- throw Error('未匹配可用的E窗通读取设备');
86503
- }
86504
- if (readData.retVal !== 0) {
86505
- throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86506
- }
86507
- console.log('获取签名==>', readData);
86508
- return readData.signPicBase64;
86509
- }
86510
- /** 获取指纹*/
86511
- static async fingerPrintRead() {
86512
- let timeOver = 30;
86513
- async function readFingerPrint() {
86514
- const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
86515
- if (!readData) {
86516
- throw Error('未匹配可用的E窗通读取设备');
86517
- }
86518
- let list = readData.fingerPrintInfo.split("|");
86519
- console.log(list);
86520
- let ret = Number(list[1]);
86521
- if (ret > 1) {
86522
- if (timeOver > 0) {
86523
- timeOver--;
86524
- return await readFingerPrint();
86525
- } else {
86526
- return {
86527
- status: 'error',
86528
- data: '已超时,请重新操作,按压指纹'
86529
- };
86530
- }
86531
- } else {
86532
- return {
86533
- status: 'success',
86534
- data: readData.fingerPrintInfo
86535
- };
86536
- }
86537
- }
86538
- let {
86539
- status,
86540
- data
86541
- } = await readFingerPrint();
86542
- if (status === 'error') {
86543
- throw Error(data);
86544
- } else {
86545
- let [method, result, quality, image, featureCode] = data.split('|');
86546
- // getimgae|1|68|......|......
86547
- // method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
86548
- return {
86549
- method,
86550
- result,
86551
- quality,
86552
- image,
86553
- featureCode
86554
- };
86555
- }
86556
- }
86557
- }
86558
- _defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
86559
- _defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
86560
- _defineProperty(EWindowPassService, "ws", void 0);
86561
- _defineProperty(EWindowPassService, "requestStore", []);
86562
86224
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
86563
86225
 
86564
86226
 
@@ -87803,7 +87465,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87803
87465
  ;// 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&
87804
87466
 
87805
87467
 
87806
-
87468
+ // import { EWindowPassService } from '../../../service/external-plugins/ewp-plugin-socket.service'
87807
87469
 
87808
87470
 
87809
87471
 
@@ -87951,8 +87613,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87951
87613
  case 1:
87952
87614
  return this.readLSIDCard();
87953
87615
  case 2:
87954
- idcardInfo = await EWindowPassService.idCardRead();
87955
- this.$emit('click', idcardInfo);
87616
+ // idcardInfo = await EWindowPassService.idCardRead()
87617
+ // this.$emit('click', idcardInfo)
87956
87618
  break;
87957
87619
  case 3:
87958
87620
  const data = await MRAdbReadService.idCardRead();
@@ -88002,8 +87664,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88002
87664
  break;
88003
87665
  case 2:
88004
87666
  {
88005
- const data = await EWindowPassService.faceValidateWithIdCardRead();
88006
- this.$emit('click', data);
87667
+ // const data = await EWindowPassService.faceValidateWithIdCardRead()
87668
+ // this.$emit('click', data)
88007
87669
  break;
88008
87670
  }
88009
87671
  case 3:
@@ -88034,7 +87696,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88034
87696
  let idcardInfo;
88035
87697
  switch (this.readMachineType) {
88036
87698
  case 2:
88037
- idcardInfo = await EWindowPassService.socialSecurityCardRead();
87699
+ // idcardInfo = await EWindowPassService.socialSecurityCardRead()
88038
87700
  break;
88039
87701
  case 4:
88040
87702
  idcardInfo = await HuzReadService.socialSecurityCardRead();
@@ -88061,7 +87723,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88061
87723
  userSignature = await SignReadService.read(PluginApiType.hwSign);
88062
87724
  break;
88063
87725
  case 2:
88064
- userSignature = await EWindowPassService.signNameRead();
87726
+ // userSignature = await EWindowPassService.signNameRead()
88065
87727
  break;
88066
87728
  case 3:
88067
87729
  // 捷宇
@@ -88210,11 +87872,11 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88210
87872
  ;
88211
87873
  var id_card_reader_button_component = normalizeComponent(
88212
87874
  src_id_card_reader_buttonvue_type_script_lang_js_,
88213
- id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render,
88214
- id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns,
87875
+ id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_render,
87876
+ id_card_reader_buttonvue_type_template_id_88636c88_scoped_true_staticRenderFns,
88215
87877
  false,
88216
87878
  null,
88217
- "19ae37ba",
87879
+ "88636c88",
88218
87880
  null
88219
87881
 
88220
87882
  )