unify-external-plugin-platform 0.0.2-76 → 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.
@@ -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 => {
@@ -85090,7 +85088,7 @@ class WeiRongPluginService {
85090
85088
  }
85091
85089
  static async read(method) {
85092
85090
  await this.startConnect(method);
85093
- const methodDesc = WEIRONGMethodDesc[method];
85091
+ // const methodDesc = WEIRONGMethodDesc[method];
85094
85092
  if (this.ws.readyState === 1) {
85095
85093
  let jsonString;
85096
85094
  switch (method) {
@@ -85158,7 +85156,7 @@ class WeiRongPluginService {
85158
85156
  });
85159
85157
  });
85160
85158
  } else {
85161
- throw Error(methodDesc + '未准备完成');
85159
+ throw Error('设备未准备完成');
85162
85160
  }
85163
85161
  }
85164
85162
  /** 读取身份证和永居证*/
@@ -85873,8 +85871,8 @@ id_card_reader_eloam.install = Vue => {
85873
85871
  Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
85874
85872
  };
85875
85873
  /* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
85876
- ;// 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&
85877
- 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() {
85878
85876
  var _vm = this,
85879
85877
  _c = _vm._self._c;
85880
85878
  return _vm.tip ? _c('el-tooltip', {
@@ -85951,7 +85949,7 @@ var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = func
85951
85949
  }
85952
85950
  })], 2);
85953
85951
  };
85954
- 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 = [];
85955
85953
 
85956
85954
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
85957
85955
 
@@ -86223,338 +86221,6 @@ _defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chrome
86223
86221
  _defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
86224
86222
  _defineProperty(SignReadService, "ws", void 0);
86225
86223
  _defineProperty(SignReadService, "requestStore", []);
86226
- ;// CONCATENATED MODULE: ./packages/service/external-plugins/ewp-plugin-socket.service.ts
86227
-
86228
-
86229
- /**
86230
- * 沃斯德人证交互终端
86231
- * E窗通WEBSOCKET服务
86232
- *
86233
- * */
86234
-
86235
- var EWindowPassMethodCode;
86236
- (function (EWindowPassMethodCode) {
86237
- /** 读取社保卡 */
86238
- EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
86239
- /** 获取签名*/
86240
- EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
86241
- /** 读取二代身份证 */
86242
- EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
86243
- /** 人证比对 */
86244
- EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
86245
- /** 获取指纹 */
86246
- EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
86247
- })(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
86248
- const EWindowPassMethodDesc = {
86249
- [EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
86250
- [EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
86251
- [EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
86252
- [EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
86253
- [EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
86254
- };
86255
- class EWindowPassService {
86256
- static startConnect(method) {
86257
- if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
86258
- return this;
86259
- }
86260
- let webSocketUrl = '';
86261
- switch (method) {
86262
- case EWindowPassMethodCode.FingerPrint_Base64:
86263
- webSocketUrl = this.fingerPrintBasWebSocketUrl;
86264
- break;
86265
- default:
86266
- webSocketUrl = this.iReadCardBasWebSocketUrl;
86267
- break;
86268
- }
86269
- const ws = new WebSocket(webSocketUrl);
86270
- let resolved;
86271
- const onConnect = new Promise(resolve => {
86272
- resolved = resolve;
86273
- });
86274
- ws.onopen = () => {
86275
- resolved(true);
86276
- };
86277
- ws.onmessage = event => {
86278
- if (method === EWindowPassMethodCode.FingerPrint_Base64) {
86279
- // 指纹后端返回的是string
86280
- event = {
86281
- ...event,
86282
- data: JSON.stringify({
86283
- fingerPrintInfo: event.data
86284
- })
86285
- };
86286
- }
86287
- this.handleMessage(event);
86288
- };
86289
- ws.onclose = () => this.handleClose();
86290
- ws.onerror = () => this.handleError();
86291
- this.ws = ws;
86292
- return onConnect;
86293
- }
86294
- static handleError() {
86295
- for (const type in this.requestStore) {
86296
- this.requestStore.forEach(({
86297
- reject
86298
- }) => {
86299
- reject('handleError');
86300
- });
86301
- }
86302
- throw Error('E窗通设备功能加载失败');
86303
- }
86304
- static handleClose() {
86305
- for (const type in this.requestStore) {
86306
- this.requestStore.forEach(({
86307
- reject
86308
- }) => {
86309
- reject('close');
86310
- });
86311
- }
86312
- }
86313
- static handleMessage(msg) {
86314
- let data = '';
86315
- try {
86316
- data = JSON.parse(msg.data);
86317
- } catch (e) {
86318
- data = '';
86319
- }
86320
- this.requestStore.forEach(({
86321
- resolve
86322
- }) => {
86323
- resolve(data);
86324
- });
86325
- this.requestStore = [];
86326
- this.ws.close();
86327
- }
86328
- static async read(method) {
86329
- await this.startConnect(method);
86330
- const methodDesc = EWindowPassMethodDesc[method];
86331
- if (this.ws.readyState === 1) {
86332
- if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
86333
- let jsonString;
86334
- // outTimes:超时时间(秒)
86335
- switch (method) {
86336
- case EWindowPassMethodCode.ReadIDCard_Base64:
86337
- // cardReader:0 读卡器-USB;1 读卡器-COM
86338
- jsonString = JSON.stringify({
86339
- method,
86340
- args: {
86341
- outTimes: 30,
86342
- cardReader: 1
86343
- }
86344
- });
86345
- break;
86346
- case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
86347
- // cardReader:0 读卡器-USB;1 读卡器-COM
86348
- jsonString = JSON.stringify({
86349
- method,
86350
- args: {
86351
- outTimes: 30,
86352
- cardReader: 1,
86353
- cameraType: 0
86354
- }
86355
- });
86356
- break;
86357
- case EWindowPassMethodCode.iReadCardBas:
86358
- // icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
86359
- jsonString = JSON.stringify({
86360
- method,
86361
- args: {
86362
- icType: '1'
86363
- }
86364
- });
86365
- break;
86366
- case EWindowPassMethodCode.FingerPrint_Base64:
86367
- // 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
86368
- jsonString = 'getimgae,1,0,288,0';
86369
- break;
86370
- default:
86371
- jsonString = JSON.stringify({
86372
- method,
86373
- args: {
86374
- outTimes: 30
86375
- }
86376
- });
86377
- break;
86378
- }
86379
- this.ws.send(jsonString);
86380
- return new Promise((resolve, reject) => {
86381
- if (!this.requestStore) {
86382
- this.requestStore = [];
86383
- }
86384
- this.requestStore.push({
86385
- resolve,
86386
- reject
86387
- });
86388
- });
86389
- } else {
86390
- throw Error(methodDesc + '未准备完成');
86391
- }
86392
- }
86393
- /**
86394
- * 读取二代身份证
86395
- * */
86396
- static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
86397
- const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
86398
- console.log('读取二代身份证==>', readData);
86399
- if (!readData) {
86400
- throw Error('未匹配可用的E窗通读取设备');
86401
- }
86402
- if (readData.retVal !== 0) {
86403
- throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86404
- }
86405
- const idInfo = readData.idInfo.data;
86406
- const {
86407
- name,
86408
- sex,
86409
- birthday,
86410
- address,
86411
- id_num,
86412
- nations
86413
- } = idInfo;
86414
- const IDCardData = {
86415
- info: {
86416
- name,
86417
- sex,
86418
- birthday: birthday.replace('-', '').replace('-', ''),
86419
- address,
86420
- cardId: id_num,
86421
- nation: nations
86422
- },
86423
- headImage: readData.idPhotoPicBase64
86424
- };
86425
- console.log('读取二代身份证结果==>', IDCardData);
86426
- return IDCardData;
86427
- }
86428
- /**
86429
- * 人证比对
86430
- */
86431
- static async faceValidateWithIdCardRead() {
86432
- const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
86433
- console.log('人证比对==>', readData);
86434
- if (!readData) {
86435
- throw Error('未匹配可用的E窗通读取设备');
86436
- }
86437
- if (readData.retVal !== 0) {
86438
- throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86439
- }
86440
- const idInfo = readData.idInfo.data;
86441
- const {
86442
- name,
86443
- sex,
86444
- birth,
86445
- address,
86446
- idNo,
86447
- nation
86448
- } = idInfo;
86449
- const IDCardData = {
86450
- idCard: {
86451
- info: {
86452
- name,
86453
- sex,
86454
- birthday: birth.replace('-', '').replace('-', ''),
86455
- address,
86456
- cardId: idNo,
86457
- nation
86458
- },
86459
- headImage: readData.idPhotoBase64
86460
- },
86461
- faceimg: readData.scenceBase64
86462
- };
86463
- console.log('人证比对结果==>', IDCardData);
86464
- return IDCardData;
86465
- }
86466
- /** 读取社保卡 */
86467
- static async socialSecurityCardRead() {
86468
- const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
86469
- if (!readData) {
86470
- throw Error('未匹配可用的E窗通读取设备');
86471
- }
86472
- if (readData.retVal !== 0) {
86473
- throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
86474
- }
86475
- // 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
86476
- const outInfo = readData.outInfo;
86477
- const outInfoArray = outInfo.split('|');
86478
- const cardId = outInfoArray[1];
86479
- const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
86480
- const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
86481
- const IDCardData = {
86482
- info: {
86483
- name: outInfoArray[4],
86484
- sex,
86485
- birthday,
86486
- address: '',
86487
- cardId
86488
- },
86489
- headImage: ''
86490
- };
86491
- console.log('读取社保卡==>', readData);
86492
- return IDCardData;
86493
- }
86494
- /** 获取签名-base64 */
86495
- static async signNameRead() {
86496
- const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
86497
- if (!readData) {
86498
- throw Error('未匹配可用的E窗通读取设备');
86499
- }
86500
- if (readData.retVal !== 0) {
86501
- throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86502
- }
86503
- console.log('获取签名==>', readData);
86504
- return readData.signPicBase64;
86505
- }
86506
- /** 获取指纹*/
86507
- static async fingerPrintRead() {
86508
- let timeOver = 30;
86509
- async function readFingerPrint() {
86510
- const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
86511
- if (!readData) {
86512
- throw Error('未匹配可用的E窗通读取设备');
86513
- }
86514
- let list = readData.fingerPrintInfo.split("|");
86515
- console.log(list);
86516
- let ret = Number(list[1]);
86517
- if (ret > 1) {
86518
- if (timeOver > 0) {
86519
- timeOver--;
86520
- return await readFingerPrint();
86521
- } else {
86522
- return {
86523
- status: 'error',
86524
- data: '已超时,请重新操作,按压指纹'
86525
- };
86526
- }
86527
- } else {
86528
- return {
86529
- status: 'success',
86530
- data: readData.fingerPrintInfo
86531
- };
86532
- }
86533
- }
86534
- let {
86535
- status,
86536
- data
86537
- } = await readFingerPrint();
86538
- if (status === 'error') {
86539
- throw Error(data);
86540
- } else {
86541
- let [method, result, quality, image, featureCode] = data.split('|');
86542
- // getimgae|1|68|......|......
86543
- // method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
86544
- return {
86545
- method,
86546
- result,
86547
- quality,
86548
- image,
86549
- featureCode
86550
- };
86551
- }
86552
- }
86553
- }
86554
- _defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
86555
- _defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
86556
- _defineProperty(EWindowPassService, "ws", void 0);
86557
- _defineProperty(EWindowPassService, "requestStore", []);
86558
86224
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
86559
86225
 
86560
86226
 
@@ -87799,7 +87465,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87799
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&
87800
87466
 
87801
87467
 
87802
-
87468
+ // import { EWindowPassService } from '../../../service/external-plugins/ewp-plugin-socket.service'
87803
87469
 
87804
87470
 
87805
87471
 
@@ -87947,8 +87613,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87947
87613
  case 1:
87948
87614
  return this.readLSIDCard();
87949
87615
  case 2:
87950
- idcardInfo = await EWindowPassService.idCardRead();
87951
- this.$emit('click', idcardInfo);
87616
+ // idcardInfo = await EWindowPassService.idCardRead()
87617
+ // this.$emit('click', idcardInfo)
87952
87618
  break;
87953
87619
  case 3:
87954
87620
  const data = await MRAdbReadService.idCardRead();
@@ -87998,8 +87664,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87998
87664
  break;
87999
87665
  case 2:
88000
87666
  {
88001
- const data = await EWindowPassService.faceValidateWithIdCardRead();
88002
- this.$emit('click', data);
87667
+ // const data = await EWindowPassService.faceValidateWithIdCardRead()
87668
+ // this.$emit('click', data)
88003
87669
  break;
88004
87670
  }
88005
87671
  case 3:
@@ -88030,7 +87696,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88030
87696
  let idcardInfo;
88031
87697
  switch (this.readMachineType) {
88032
87698
  case 2:
88033
- idcardInfo = await EWindowPassService.socialSecurityCardRead();
87699
+ // idcardInfo = await EWindowPassService.socialSecurityCardRead()
88034
87700
  break;
88035
87701
  case 4:
88036
87702
  idcardInfo = await HuzReadService.socialSecurityCardRead();
@@ -88057,7 +87723,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88057
87723
  userSignature = await SignReadService.read(PluginApiType.hwSign);
88058
87724
  break;
88059
87725
  case 2:
88060
- userSignature = await EWindowPassService.signNameRead();
87726
+ // userSignature = await EWindowPassService.signNameRead()
88061
87727
  break;
88062
87728
  case 3:
88063
87729
  // 捷宇
@@ -88206,11 +87872,11 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88206
87872
  ;
88207
87873
  var id_card_reader_button_component = normalizeComponent(
88208
87874
  src_id_card_reader_buttonvue_type_script_lang_js_,
88209
- id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render,
88210
- 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,
88211
87877
  false,
88212
87878
  null,
88213
- "19ae37ba",
87879
+ "88636c88",
88214
87880
  null
88215
87881
 
88216
87882
  )