unify-external-plugin-platform 0.0.2-71 → 0.0.2-73

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.
@@ -84019,8 +84019,8 @@ var scanner_cameravue_type_template_id_00e9072f_scoped_true_render = function re
84019
84019
  };
84020
84020
  var scanner_cameravue_type_template_id_00e9072f_scoped_true_staticRenderFns = [];
84021
84021
 
84022
- ;// 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/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=template&id=bc9cce92&scoped=true&
84023
- var scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_render = function render() {
84022
+ ;// 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/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=template&id=7ca74565&scoped=true&
84023
+ var scanner_camera_componentvue_type_template_id_7ca74565_scoped_true_render = function render() {
84024
84024
  var _vm = this,
84025
84025
  _c = _vm._self._c;
84026
84026
  return _c('div', {
@@ -84084,7 +84084,7 @@ var scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_render = f
84084
84084
  }, [_vm._v(_vm._s(item.label))]), _vm._t("action")];
84085
84085
  })], 2)])]);
84086
84086
  };
84087
- var scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_staticRenderFns = [];
84087
+ var scanner_camera_componentvue_type_template_id_7ca74565_scoped_true_staticRenderFns = [];
84088
84088
 
84089
84089
  ;// CONCATENATED MODULE: ./packages/utils/custom-axios.ts
84090
84090
  /**
@@ -84994,764 +84994,13 @@ class UdsPluginSocketService {
84994
84994
  _defineProperty(UdsPluginSocketService, "scannerCameraUrl", 'ws://127.0.0.1:8341');
84995
84995
  _defineProperty(UdsPluginSocketService, "ws", void 0);
84996
84996
  _defineProperty(UdsPluginSocketService, "requestStore", []);
84997
- ;// CONCATENATED MODULE: ./packages/service/external-plugins/ewp-plugin-socket.service.ts
84998
-
84999
-
85000
- /**
85001
- * 沃斯德人证交互终端
85002
- * E窗通WEBSOCKET服务
85003
- *
85004
- * */
85005
-
85006
- var EWindowPassMethodCode;
85007
- (function (EWindowPassMethodCode) {
85008
- /** 读取社保卡 */
85009
- EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
85010
- /** 获取签名*/
85011
- EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
85012
- /** 读取二代身份证 */
85013
- EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
85014
- /** 人证比对 */
85015
- EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
85016
- /** 获取指纹 */
85017
- EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
85018
- })(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
85019
- const EWindowPassMethodDesc = {
85020
- [EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
85021
- [EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
85022
- [EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
85023
- [EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
85024
- [EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
85025
- };
85026
- class EWindowPassService {
85027
- static startConnect(method) {
85028
- if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
85029
- return this;
85030
- }
85031
- let webSocketUrl = '';
85032
- switch (method) {
85033
- case EWindowPassMethodCode.FingerPrint_Base64:
85034
- webSocketUrl = this.fingerPrintBasWebSocketUrl;
85035
- break;
85036
- default:
85037
- webSocketUrl = this.iReadCardBasWebSocketUrl;
85038
- break;
85039
- }
85040
- const ws = new WebSocket(webSocketUrl);
85041
- let resolved;
85042
- const onConnect = new Promise(resolve => {
85043
- resolved = resolve;
85044
- });
85045
- ws.onopen = () => {
85046
- resolved(true);
85047
- };
85048
- ws.onmessage = event => {
85049
- if (method === EWindowPassMethodCode.FingerPrint_Base64) {
85050
- // 指纹后端返回的是string
85051
- event = {
85052
- ...event,
85053
- data: JSON.stringify({
85054
- fingerPrintInfo: event.data
85055
- })
85056
- };
85057
- }
85058
- this.handleMessage(event);
85059
- };
85060
- ws.onclose = () => this.handleClose();
85061
- ws.onerror = () => this.handleError();
85062
- this.ws = ws;
85063
- return onConnect;
85064
- }
85065
- static handleError() {
85066
- for (const type in this.requestStore) {
85067
- this.requestStore.forEach(({
85068
- reject
85069
- }) => {
85070
- reject('handleError');
85071
- });
85072
- }
85073
- throw Error('E窗通设备功能加载失败');
85074
- }
85075
- static handleClose() {
85076
- for (const type in this.requestStore) {
85077
- this.requestStore.forEach(({
85078
- reject
85079
- }) => {
85080
- reject('close');
85081
- });
85082
- }
85083
- }
85084
- static handleMessage(msg) {
85085
- let data = '';
85086
- try {
85087
- data = JSON.parse(msg.data);
85088
- } catch (e) {
85089
- data = '';
85090
- }
85091
- this.requestStore.forEach(({
85092
- resolve
85093
- }) => {
85094
- resolve(data);
85095
- });
85096
- this.requestStore = [];
85097
- this.ws.close();
85098
- }
85099
- static async read(method) {
85100
- await this.startConnect(method);
85101
- const methodDesc = EWindowPassMethodDesc[method];
85102
- if (this.ws.readyState === 1) {
85103
- if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
85104
- let jsonString;
85105
- // outTimes:超时时间(秒)
85106
- switch (method) {
85107
- case EWindowPassMethodCode.ReadIDCard_Base64:
85108
- // cardReader:0 读卡器-USB;1 读卡器-COM
85109
- jsonString = JSON.stringify({
85110
- method,
85111
- args: {
85112
- outTimes: 30,
85113
- cardReader: 1
85114
- }
85115
- });
85116
- break;
85117
- case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
85118
- // cardReader:0 读卡器-USB;1 读卡器-COM
85119
- jsonString = JSON.stringify({
85120
- method,
85121
- args: {
85122
- outTimes: 30,
85123
- cardReader: 1,
85124
- cameraType: 0
85125
- }
85126
- });
85127
- break;
85128
- case EWindowPassMethodCode.iReadCardBas:
85129
- // icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
85130
- jsonString = JSON.stringify({
85131
- method,
85132
- args: {
85133
- icType: '1'
85134
- }
85135
- });
85136
- break;
85137
- case EWindowPassMethodCode.FingerPrint_Base64:
85138
- // 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
85139
- jsonString = 'getimgae,1,0,288,0';
85140
- break;
85141
- default:
85142
- jsonString = JSON.stringify({
85143
- method,
85144
- args: {
85145
- outTimes: 30
85146
- }
85147
- });
85148
- break;
85149
- }
85150
- this.ws.send(jsonString);
85151
- return new Promise((resolve, reject) => {
85152
- if (!this.requestStore) {
85153
- this.requestStore = [];
85154
- }
85155
- this.requestStore.push({
85156
- resolve,
85157
- reject
85158
- });
85159
- });
85160
- } else {
85161
- throw Error(methodDesc + '未准备完成');
85162
- }
85163
- }
85164
- /**
85165
- * 读取二代身份证
85166
- * */
85167
- static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
85168
- const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
85169
- console.log('读取二代身份证==>', readData);
85170
- if (!readData) {
85171
- throw Error('未匹配可用的E窗通读取设备');
85172
- }
85173
- if (readData.retVal !== 0) {
85174
- throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
85175
- }
85176
- const idInfo = readData.idInfo.data;
85177
- const {
85178
- name,
85179
- sex,
85180
- birthday,
85181
- address,
85182
- id_num,
85183
- nations
85184
- } = idInfo;
85185
- const IDCardData = {
85186
- info: {
85187
- name,
85188
- sex,
85189
- birthday: birthday.replace('-', '').replace('-', ''),
85190
- address,
85191
- cardId: id_num,
85192
- nation: nations
85193
- },
85194
- headImage: readData.idPhotoPicBase64
85195
- };
85196
- console.log('读取二代身份证结果==>', IDCardData);
85197
- return IDCardData;
85198
- }
85199
- /**
85200
- * 人证比对
85201
- */
85202
- static async faceValidateWithIdCardRead() {
85203
- const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
85204
- console.log('人证比对==>', readData);
85205
- if (!readData) {
85206
- throw Error('未匹配可用的E窗通读取设备');
85207
- }
85208
- if (readData.retVal !== 0) {
85209
- throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
85210
- }
85211
- const idInfo = readData.idInfo.data;
85212
- const {
85213
- name,
85214
- sex,
85215
- birth,
85216
- address,
85217
- idNo,
85218
- nation
85219
- } = idInfo;
85220
- const IDCardData = {
85221
- idCard: {
85222
- info: {
85223
- name,
85224
- sex,
85225
- birthday: birth.replace('-', '').replace('-', ''),
85226
- address,
85227
- cardId: idNo,
85228
- nation
85229
- },
85230
- headImage: readData.idPhotoBase64
85231
- },
85232
- faceimg: readData.scenceBase64
85233
- };
85234
- console.log('人证比对结果==>', IDCardData);
85235
- return IDCardData;
85236
- }
85237
- /** 读取社保卡 */
85238
- static async socialSecurityCardRead() {
85239
- const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
85240
- if (!readData) {
85241
- throw Error('未匹配可用的E窗通读取设备');
85242
- }
85243
- if (readData.retVal !== 0) {
85244
- throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
85245
- }
85246
- // 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
85247
- const outInfo = readData.outInfo;
85248
- const outInfoArray = outInfo.split('|');
85249
- const cardId = outInfoArray[1];
85250
- const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
85251
- const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
85252
- const IDCardData = {
85253
- info: {
85254
- name: outInfoArray[4],
85255
- sex,
85256
- birthday,
85257
- address: '',
85258
- cardId
85259
- },
85260
- headImage: ''
85261
- };
85262
- console.log('读取社保卡==>', readData);
85263
- return IDCardData;
85264
- }
85265
- /** 获取签名-base64 */
85266
- static async signNameRead() {
85267
- const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
85268
- if (!readData) {
85269
- throw Error('未匹配可用的E窗通读取设备');
85270
- }
85271
- if (readData.retVal !== 0) {
85272
- throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
85273
- }
85274
- console.log('获取签名==>', readData);
85275
- return readData.signPicBase64;
85276
- }
85277
- /** 获取指纹*/
85278
- static async fingerPrintRead() {
85279
- let timeOver = 30;
85280
- async function readFingerPrint() {
85281
- const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
85282
- if (!readData) {
85283
- throw Error('未匹配可用的E窗通读取设备');
85284
- }
85285
- let list = readData.fingerPrintInfo.split("|");
85286
- console.log(list);
85287
- let ret = Number(list[1]);
85288
- if (ret > 1) {
85289
- if (timeOver > 0) {
85290
- timeOver--;
85291
- return await readFingerPrint();
85292
- } else {
85293
- return {
85294
- status: 'error',
85295
- data: '已超时,请重新操作,按压指纹'
85296
- };
85297
- }
85298
- } else {
85299
- return {
85300
- status: 'success',
85301
- data: readData.fingerPrintInfo
85302
- };
85303
- }
85304
- }
85305
- let {
85306
- status,
85307
- data
85308
- } = await readFingerPrint();
85309
- if (status === 'error') {
85310
- throw Error(data);
85311
- } else {
85312
- let [method, result, quality, image, featureCode] = data.split('|');
85313
- // getimgae|1|68|......|......
85314
- // method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
85315
- return {
85316
- method,
85317
- result,
85318
- quality,
85319
- image,
85320
- featureCode
85321
- };
85322
- }
85323
- }
85324
- }
85325
- _defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
85326
- _defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
85327
- _defineProperty(EWindowPassService, "ws", void 0);
85328
- _defineProperty(EWindowPassService, "requestStore", []);
85329
- ;// CONCATENATED MODULE: ./packages/service/external-plugins/wei-rong-plugin-socket.service.ts
85330
-
85331
-
85332
-
85333
-
85334
- /**
85335
- * @author: lvcy
85336
- * @date: 2024-03-22
85337
- * @description:国产客户端,硬件对接
85338
- */
85339
- var WEIRONGMethodCode;
85340
- (function (WEIRONGMethodCode) {
85341
- /** 读卡 */
85342
- WEIRONGMethodCode["ReadCard_Base64"] = "ReadCard_Base64";
85343
- /** 开始签名*/
85344
- WEIRONGMethodCode["StartSignName"] = "StartSignName";
85345
- /** 获取签名状态*/
85346
- WEIRONGMethodCode["GetSignNameStatus"] = "GetSignNameStatus";
85347
- /** 获取签名*/
85348
- WEIRONGMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
85349
- /** 人证比对 */
85350
- WEIRONGMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
85351
- /** 打开高拍仪器*/
85352
- WEIRONGMethodCode["TurnOnTheCamera"] = "TurnOnTheCamera";
85353
- /** 拍照*/
85354
- WEIRONGMethodCode["ScannerCamera"] = "ScannerCamera";
85355
- })(WEIRONGMethodCode || (WEIRONGMethodCode = {}));
85356
- const WEIRONGMethodDesc = {
85357
- [WEIRONGMethodCode.ReadCard_Base64]: '读卡',
85358
- [WEIRONGMethodCode.GetSignName_Base64]: '获取签名',
85359
- [WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对'
85360
- };
85361
- class WeiRongPluginService {
85362
- static startConnect(method) {
85363
- console.log('startConnect', method, this.ws?.readyState, WebSocket.CONNECTING);
85364
- if (this.ws && this.ws.readyState === WebSocket.OPEN) {
85365
- return this;
85366
- }
85367
- console.log('重新链接');
85368
- const ws = new WebSocket(this.webSocketUrl);
85369
- let resolved;
85370
- const onConnect = new Promise(resolve => {
85371
- resolved = resolve;
85372
- });
85373
- ws.onopen = () => {
85374
- resolved(true);
85375
- };
85376
- ws.onmessage = event => {
85377
- if (method === EWindowPassMethodCode.FingerPrint_Base64) {
85378
- // 指纹后端返回的是string
85379
- event = {
85380
- ...event,
85381
- data: JSON.stringify({
85382
- fingerPrintInfo: event.data
85383
- })
85384
- };
85385
- }
85386
- this.handleMessage(event);
85387
- };
85388
- ws.onclose = () => this.handleClose();
85389
- ws.onerror = () => this.handleError();
85390
- this.ws = ws;
85391
- return onConnect;
85392
- }
85393
- static handleError() {
85394
- for (const type in this.requestStore) {
85395
- this.requestStore.forEach(({
85396
- reject
85397
- }) => {
85398
- reject('handleError');
85399
- });
85400
- }
85401
- throw Error('设备功能加载失败');
85402
- }
85403
- static handleClose() {
85404
- for (const type in this.requestStore) {
85405
- this.requestStore.forEach(({
85406
- reject
85407
- }) => {
85408
- reject('close');
85409
- });
85410
- }
85411
- }
85412
- static handleMessage(msg) {
85413
- let data = '';
85414
- try {
85415
- data = JSON.parse(msg.data);
85416
- } catch (e) {
85417
- data = '';
85418
- }
85419
- if (data.method === 'FaceScreenStream' || data.method === 'VideoStream') {
85420
- const event = new ScannerCameraRefreshPhotoEvent(data.imgBase64);
85421
- return window.dispatchEvent(event);
85422
- } else {
85423
- this.requestStore.forEach(({
85424
- resolve
85425
- }) => {
85426
- resolve(data);
85427
- });
85428
- this.requestStore = [];
85429
- }
85430
- // this.ws.close();
85431
- }
85432
-
85433
- static async read(method) {
85434
- await this.startConnect(method);
85435
- const methodDesc = WEIRONGMethodDesc[method];
85436
- if (this.ws.readyState === 1) {
85437
- let jsonString;
85438
- switch (method) {
85439
- case WEIRONGMethodCode.ReadCard_Base64:
85440
- jsonString = JSON.stringify({
85441
- method: 'ReadIDCard_Base64',
85442
- args: {
85443
- outTimes: 30,
85444
- cardReader: 0
85445
- }
85446
- });
85447
- break;
85448
- case WEIRONGMethodCode.FaceValidateWithIdCard_Base64:
85449
- jsonString = JSON.stringify({
85450
- method: 'FaceValidateWithIdCard_Base64',
85451
- args: {
85452
- outTimes: 30,
85453
- score: 75
85454
- }
85455
- });
85456
- break;
85457
- case WEIRONGMethodCode.StartSignName:
85458
- jsonString = JSON.stringify({
85459
- method: 'SignNameScreen_Start',
85460
- args: {
85461
- outTimes: 30
85462
- }
85463
- });
85464
- break;
85465
- case WEIRONGMethodCode.GetSignNameStatus:
85466
- jsonString = JSON.stringify({
85467
- method: 'SignNameScreen_Status',
85468
- args: {}
85469
- });
85470
- break;
85471
- case WEIRONGMethodCode.GetSignName_Base64:
85472
- jsonString = JSON.stringify({
85473
- method: 'SignNameScreen_Get',
85474
- args: {}
85475
- });
85476
- break;
85477
- case WEIRONGMethodCode.TurnOnTheCamera:
85478
- jsonString = JSON.stringify({
85479
- method: 'VideoStart',
85480
- args: {}
85481
- });
85482
- break;
85483
- case WEIRONGMethodCode.ScannerCamera:
85484
- jsonString = JSON.stringify({
85485
- method: 'GetCameraImage',
85486
- args: {
85487
- imagePath: ''
85488
- }
85489
- });
85490
- break;
85491
- }
85492
- this.ws.send(jsonString);
85493
- return new Promise((resolve, reject) => {
85494
- if (!this.requestStore) {
85495
- this.requestStore = [];
85496
- }
85497
- this.requestStore.push({
85498
- resolve,
85499
- reject
85500
- });
85501
- });
85502
- } else {
85503
- throw Error(methodDesc + '未准备完成');
85504
- }
85505
- }
85506
- /** 读取身份证和永居证*/
85507
- static async idCardRead() {
85508
- const readData = await WeiRongPluginService.read(WEIRONGMethodCode.ReadCard_Base64);
85509
- if (!readData) {
85510
- throw Error('未匹配到可用的读取设备');
85511
- }
85512
- if (readData.retVal !== 0) {
85513
- this.ws?.close();
85514
- throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
85515
- }
85516
- let idInfo = readData.idInfo;
85517
- // name:姓名 "ENfullname":"英文姓名" sex:性别 nation:民族 number 身份证号码 birthday: 生日 address: 地址,
85518
- // organs:签发机关 signdate:开始有效期 validterm: 结束有效期
85519
- let {
85520
- name,
85521
- ENfullname: englishName,
85522
- Nationality,
85523
- sex,
85524
- birthday,
85525
- address,
85526
- number,
85527
- nation,
85528
- organs: police,
85529
- signdate: validStart,
85530
- validterm: validEnd
85531
- } = idInfo;
85532
- let chineseName = '',
85533
- cardType = '1',
85534
- nationality = '中国';
85535
- // 外国人永居证
85536
- if (readData.cardType == 1 || readData.cardType == 2) {
85537
- cardType = '9'; // 永居证
85538
- chineseName = name;
85539
- name = name || englishName; // 姓名,先读中文名,没有时读英文名
85540
- police = police || '中华人民共和国国家移民管理局'; // 发证机关,读不到,默认
85541
- nationality = Nationality; // 永居证国籍放在名族里面的
85542
- nation = '';
85543
- } else {
85544
- // 身份证
85545
- cardType = '1'; // 身份证
85546
- }
85547
-
85548
- const IDCardData = {
85549
- info: {
85550
- cardType,
85551
- nationality,
85552
- name,
85553
- chineseName,
85554
- englishName,
85555
- sex,
85556
- birthday: birthday.replace('-', '').replace('-', ''),
85557
- address,
85558
- cardId: number,
85559
- nation,
85560
- police,
85561
- validStart,
85562
- validEnd
85563
- },
85564
- headImage: readData.idPhotoBase64
85565
- };
85566
- this.ws?.close();
85567
- return IDCardData;
85568
- }
85569
- /** 读取社保卡 */
85570
- static async socialSecurityCardRead() {
85571
- const readData = await WeiRongPluginService.read(WEIRONGMethodCode.ReadCard_Base64);
85572
- if (!readData) {
85573
- throw Error('未匹配可用的读取设备');
85574
- }
85575
- if (readData.retVal !== 0) {
85576
- this.ws?.close();
85577
- throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.idInfo);
85578
- }
85579
- // 返回数据:cardType 3 社保卡
85580
- // idInfo: {
85581
- // name:姓名
85582
- // sex:性别
85583
- // nation:民族
85584
- // cardnumber:卡号
85585
- // number:社会保障号码(身份证号)
85586
- // birthday:出生日期"\
85587
- // city:城市代码
85588
- // signdate:开始有效期
85589
- // validterm:结束有效期
85590
- // cardveVrsion:社保卡版本
85591
- // }
85592
- const idInfo = readData.idInfo;
85593
- let {
85594
- name,
85595
- sex,
85596
- birthday,
85597
- number: cardId,
85598
- cardnumber
85599
- } = idInfo;
85600
- const IDCardData = {
85601
- info: {
85602
- name,
85603
- sex,
85604
- birthday,
85605
- address: '',
85606
- cardId,
85607
- cardnumber
85608
- },
85609
- headImage: ''
85610
- };
85611
- this.ws?.close();
85612
- return IDCardData;
85613
- }
85614
- // 港澳台居住证协议
85615
- // {
85616
- // "method": "ReadIDCard_Base64",
85617
- // "retVal": 0,
85618
- // "errMsg":"",
85619
- // "cardType":"4",
85620
- // "idInfo":{
85621
- // "name":"中文姓名",
85622
- // "sex":"性别",
85623
- // "birthday":"出生日期",
85624
- // "address":"(例:杭州市西湖区XXXX)",
85625
- // "number":"证件号码",
85626
- // "organs":"签发机关",
85627
- // "signdate":"开始有效期",
85628
- // "validterm":"结束有效期",
85629
- // "signCount":"签证次数",
85630
- // "passNu":"通行证号"
85631
- // },
85632
- // "idPhotoBase64":"小头像base64图片格式"
85633
- // }
85634
- /**
85635
- * 人证比对
85636
- */
85637
- static async faceValidateWithIdCardRead() {
85638
- const readData = await WeiRongPluginService.read(WEIRONGMethodCode.FaceValidateWithIdCard_Base64);
85639
- if (readData.method === 'FaceValidateWithIdCard_Base64' && readData.retVal == '0') {
85640
- console.log('认证成功=>', readData);
85641
- const idInfo = readData.idInfo;
85642
- let {
85643
- name,
85644
- ENfullname: englishName,
85645
- Nationality,
85646
- sex,
85647
- birthday,
85648
- address,
85649
- number,
85650
- nation,
85651
- organs: police,
85652
- signdate: validStart,
85653
- validterm: validEnd
85654
- } = idInfo;
85655
- let chineseName = '',
85656
- cardType = '1',
85657
- nationality = '中国';
85658
- // 外国人永居证
85659
- if (readData.cardType == 1 || readData.cardType == 2) {
85660
- cardType = '9'; // 永居证
85661
- chineseName = name;
85662
- name = name || englishName; // 姓名,先读中文名,没有时读英文名
85663
- police = police || '中华人民共和国国家移民管理局'; // 发证机关,读不到,默认
85664
- nationality = Nationality; // 永居证国籍放在名族里面的
85665
- nation = '';
85666
- } else {
85667
- // 身份证
85668
- cardType = '1'; // 身份证
85669
- }
85670
- // idCard:身份证信息;faceimg,拍照照片;score:对比度
85671
- const IDCardData = {
85672
- idCard: {
85673
- info: {
85674
- cardType,
85675
- nationality,
85676
- name,
85677
- chineseName,
85678
- englishName,
85679
- sex,
85680
- birthday: birthday.replace('-', '').replace('-', ''),
85681
- address,
85682
- cardId: number,
85683
- nation,
85684
- police,
85685
- validStart,
85686
- validEnd
85687
- },
85688
- headImage: readData.idPhotoBase64
85689
- },
85690
- faceimg: readData.scenceBase64,
85691
- score: readData.score
85692
- };
85693
- this.ws?.close();
85694
- return IDCardData;
85695
- } else {
85696
- this.ws?.close();
85697
- }
85698
- }
85699
- /** 签字*/
85700
- static async signNameRead() {
85701
- return new Promise(async (resolve, reject) => {
85702
- const readData = await WeiRongPluginService.read(WEIRONGMethodCode.StartSignName);
85703
- console.log('开始签名=>', readData);
85704
- if (readData.method === 'SignNameScreen_Start') {
85705
- if (readData.retVal !== 0) {
85706
- this.ws?.close();
85707
- reject(`开始签名失败,返回值:${readData.retVal},错误信息:${readData.errMsg}`);
85708
- } else {
85709
- if (!this.timer) {
85710
- this.timer = setInterval(async () => {
85711
- let status = await WeiRongPluginService.read(WEIRONGMethodCode.GetSignNameStatus);
85712
- if (status.signScreenStatus == 2) {
85713
- clearInterval(this.timer);
85714
- this.timer = null;
85715
- let res = await WeiRongPluginService.read(WEIRONGMethodCode.GetSignName_Base64);
85716
- this.ws?.close();
85717
- resolve(res.signPicBase64);
85718
- } else if (status.retVal == 3) {
85719
- clearInterval(this.timer);
85720
- this.timer = null;
85721
- this.ws?.close();
85722
- reject('签字结果=>签字失败,或意外中断!');
85723
- }
85724
- }, 2000);
85725
- }
85726
- }
85727
- }
85728
- });
85729
- }
85730
- // 开启主摄像头/副摄像头
85731
- static async turnOnTheCamera() {
85732
- await WeiRongPluginService.read(WEIRONGMethodCode.TurnOnTheCamera);
85733
- }
85734
- // 拍照
85735
- static async scanByCamera() {
85736
- // if (this.ws) this.ws.close();
85737
- let res = await WeiRongPluginService.read(WEIRONGMethodCode.ScannerCamera);
85738
- if (res.method === 'GetCameraImage' && res.retVal == 0) {
85739
- this.ws?.close();
85740
- return res.cameraImgBase64;
85741
- }
85742
- }
85743
- }
85744
- _defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:5847');
85745
- _defineProperty(WeiRongPluginService, "ws", void 0);
85746
- _defineProperty(WeiRongPluginService, "requestStore", []);
85747
- _defineProperty(WeiRongPluginService, "timer", null);
85748
84997
  ;// 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/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
85749
84998
 
85750
84999
 
85751
85000
 
85752
85001
 
85753
85002
 
85754
-
85003
+ // import { WeiRongPluginService } from '../../../../service/external-plugins/wei-rong-plugin-socket.service'
85755
85004
  const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/jpg;base64,';
85756
85005
  /* harmony default export */ var scanner_camera_componentvue_type_script_lang_js_ = ({
85757
85006
  name: "scanner-camera-component",
@@ -85840,8 +85089,8 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85840
85089
  case 6:
85841
85090
  {
85842
85091
  // 国产客户端一体机
85843
- let res = await WeiRongPluginService.scanByCamera();
85844
- this.$emit('send-scanner-result', `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${res}`);
85092
+ // let res = await WeiRongPluginService.scanByCamera();
85093
+ // this.$emit('send-scanner-result', `${BEGIN_DATA}${res}`);
85845
85094
  break;
85846
85095
  }
85847
85096
  }
@@ -85869,7 +85118,7 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85869
85118
  break;
85870
85119
  case 6:
85871
85120
  // 国产客户端一体机
85872
- await WeiRongPluginService.turnOnTheCamera();
85121
+ // await WeiRongPluginService.turnOnTheCamera();
85873
85122
  break;
85874
85123
  }
85875
85124
  },
@@ -85896,7 +85145,7 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85896
85145
  break;
85897
85146
  case 6:
85898
85147
  // 国产客户端一体机
85899
- await WeiRongPluginService.turnOnTheCamera();
85148
+ // await WeiRongPluginService.turnOnTheCamera();
85900
85149
  break;
85901
85150
  }
85902
85151
  },
@@ -85920,10 +85169,10 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85920
85169
  });
85921
85170
  ;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
85922
85171
  /* harmony default export */ var component_scanner_camera_componentvue_type_script_lang_js_ = (scanner_camera_componentvue_type_script_lang_js_);
85923
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=bc9cce92&prod&scoped=true&lang=scss&
85172
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=7ca74565&prod&scoped=true&lang=scss&
85924
85173
  // extracted by mini-css-extract-plugin
85925
85174
 
85926
- ;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=bc9cce92&prod&scoped=true&lang=scss&
85175
+ ;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=7ca74565&prod&scoped=true&lang=scss&
85927
85176
 
85928
85177
  ;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue
85929
85178
 
@@ -85936,11 +85185,11 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85936
85185
 
85937
85186
  var scanner_camera_component_component = normalizeComponent(
85938
85187
  component_scanner_camera_componentvue_type_script_lang_js_,
85939
- scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_render,
85940
- scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_staticRenderFns,
85188
+ scanner_camera_componentvue_type_template_id_7ca74565_scoped_true_render,
85189
+ scanner_camera_componentvue_type_template_id_7ca74565_scoped_true_staticRenderFns,
85941
85190
  false,
85942
85191
  null,
85943
- "bc9cce92",
85192
+ "7ca74565",
85944
85193
  null
85945
85194
 
85946
85195
  )
@@ -86235,8 +85484,8 @@ id_card_reader_eloam.install = Vue => {
86235
85484
  Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
86236
85485
  };
86237
85486
  /* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
86238
- ;// 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&
86239
- var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = function render() {
85487
+ ;// 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=3939400c&scoped=true&
85488
+ var id_card_reader_buttonvue_type_template_id_3939400c_scoped_true_render = function render() {
86240
85489
  var _vm = this,
86241
85490
  _c = _vm._self._c;
86242
85491
  return _vm.tip ? _c('el-tooltip', {
@@ -86313,7 +85562,7 @@ var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = func
86313
85562
  }
86314
85563
  })], 2);
86315
85564
  };
86316
- var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns = [];
85565
+ var id_card_reader_buttonvue_type_template_id_3939400c_scoped_true_staticRenderFns = [];
86317
85566
 
86318
85567
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
86319
85568
 
@@ -86527,7 +85776,127 @@ class SignReadService {
86527
85776
  ws.onopen = () => {
86528
85777
  resolved(true);
86529
85778
  };
86530
- ws.onmessage = event => this.handleMessage(event);
85779
+ ws.onmessage = event => this.handleMessage(event);
85780
+ ws.onclose = () => this.handleClose();
85781
+ ws.onerror = () => this.handleError();
85782
+ this.ws = ws;
85783
+ return onConnect;
85784
+ }
85785
+ static handleError() {
85786
+ for (const type in this.requestStore) {
85787
+ this.requestStore.forEach(({
85788
+ reject
85789
+ }) => {
85790
+ reject('handleError');
85791
+ });
85792
+ }
85793
+ throw Error('签字板加载失败');
85794
+ }
85795
+ static handleClose() {
85796
+ for (const type in this.requestStore) {
85797
+ this.requestStore.forEach(({
85798
+ reject
85799
+ }) => {
85800
+ reject('close');
85801
+ });
85802
+ }
85803
+ }
85804
+ static handleMessage(msg) {
85805
+ let data = msg.data;
85806
+ this.requestStore.forEach(({
85807
+ resolve
85808
+ }) => {
85809
+ resolve(data);
85810
+ });
85811
+ this.requestStore = [];
85812
+ this.ws.close();
85813
+ }
85814
+ static async read(signMode = PluginApiType.ywSign) {
85815
+ await this.startConnect(signMode);
85816
+ if (this.ws.readyState === 1) {
85817
+ console.log('签字板连接成功');
85818
+ this.ws.send(signMode);
85819
+ return new Promise((resolve, reject) => {
85820
+ if (!this.requestStore) {
85821
+ this.requestStore = [];
85822
+ }
85823
+ this.requestStore.push({
85824
+ resolve,
85825
+ reject
85826
+ });
85827
+ });
85828
+ } else {
85829
+ throw Error('签字板未准备完成');
85830
+ }
85831
+ }
85832
+ }
85833
+ _defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chromeManage');
85834
+ _defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
85835
+ _defineProperty(SignReadService, "ws", void 0);
85836
+ _defineProperty(SignReadService, "requestStore", []);
85837
+ ;// CONCATENATED MODULE: ./packages/service/external-plugins/ewp-plugin-socket.service.ts
85838
+
85839
+
85840
+ /**
85841
+ * 沃斯德人证交互终端
85842
+ * E窗通WEBSOCKET服务
85843
+ *
85844
+ * */
85845
+
85846
+ var EWindowPassMethodCode;
85847
+ (function (EWindowPassMethodCode) {
85848
+ /** 读取社保卡 */
85849
+ EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
85850
+ /** 获取签名*/
85851
+ EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
85852
+ /** 读取二代身份证 */
85853
+ EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
85854
+ /** 人证比对 */
85855
+ EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
85856
+ /** 获取指纹 */
85857
+ EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
85858
+ })(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
85859
+ const EWindowPassMethodDesc = {
85860
+ [EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
85861
+ [EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
85862
+ [EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
85863
+ [EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
85864
+ [EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
85865
+ };
85866
+ class EWindowPassService {
85867
+ static startConnect(method) {
85868
+ if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
85869
+ return this;
85870
+ }
85871
+ let webSocketUrl = '';
85872
+ switch (method) {
85873
+ case EWindowPassMethodCode.FingerPrint_Base64:
85874
+ webSocketUrl = this.fingerPrintBasWebSocketUrl;
85875
+ break;
85876
+ default:
85877
+ webSocketUrl = this.iReadCardBasWebSocketUrl;
85878
+ break;
85879
+ }
85880
+ const ws = new WebSocket(webSocketUrl);
85881
+ let resolved;
85882
+ const onConnect = new Promise(resolve => {
85883
+ resolved = resolve;
85884
+ });
85885
+ ws.onopen = () => {
85886
+ resolved(true);
85887
+ };
85888
+ ws.onmessage = event => {
85889
+ if (method === EWindowPassMethodCode.FingerPrint_Base64) {
85890
+ // 指纹后端返回的是string
85891
+ event = {
85892
+ ...event,
85893
+ data: JSON.stringify({
85894
+ fingerPrintInfo: event.data
85895
+ })
85896
+ };
85897
+ }
85898
+ this.handleMessage(event);
85899
+ };
86531
85900
  ws.onclose = () => this.handleClose();
86532
85901
  ws.onerror = () => this.handleError();
86533
85902
  this.ws = ws;
@@ -86541,7 +85910,7 @@ class SignReadService {
86541
85910
  reject('handleError');
86542
85911
  });
86543
85912
  }
86544
- throw Error('签字板加载失败');
85913
+ throw Error('E窗通设备功能加载失败');
86545
85914
  }
86546
85915
  static handleClose() {
86547
85916
  for (const type in this.requestStore) {
@@ -86553,7 +85922,12 @@ class SignReadService {
86553
85922
  }
86554
85923
  }
86555
85924
  static handleMessage(msg) {
86556
- let data = msg.data;
85925
+ let data = '';
85926
+ try {
85927
+ data = JSON.parse(msg.data);
85928
+ } catch (e) {
85929
+ data = '';
85930
+ }
86557
85931
  this.requestStore.forEach(({
86558
85932
  resolve
86559
85933
  }) => {
@@ -86562,11 +85936,58 @@ class SignReadService {
86562
85936
  this.requestStore = [];
86563
85937
  this.ws.close();
86564
85938
  }
86565
- static async read(signMode = PluginApiType.ywSign) {
86566
- await this.startConnect(signMode);
85939
+ static async read(method) {
85940
+ await this.startConnect(method);
85941
+ const methodDesc = EWindowPassMethodDesc[method];
86567
85942
  if (this.ws.readyState === 1) {
86568
- console.log('签字板连接成功');
86569
- this.ws.send(signMode);
85943
+ if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
85944
+ let jsonString;
85945
+ // outTimes:超时时间(秒)
85946
+ switch (method) {
85947
+ case EWindowPassMethodCode.ReadIDCard_Base64:
85948
+ // cardReader:0 读卡器-USB;1 读卡器-COM
85949
+ jsonString = JSON.stringify({
85950
+ method,
85951
+ args: {
85952
+ outTimes: 30,
85953
+ cardReader: 1
85954
+ }
85955
+ });
85956
+ break;
85957
+ case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
85958
+ // cardReader:0 读卡器-USB;1 读卡器-COM
85959
+ jsonString = JSON.stringify({
85960
+ method,
85961
+ args: {
85962
+ outTimes: 30,
85963
+ cardReader: 1,
85964
+ cameraType: 0
85965
+ }
85966
+ });
85967
+ break;
85968
+ case EWindowPassMethodCode.iReadCardBas:
85969
+ // icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
85970
+ jsonString = JSON.stringify({
85971
+ method,
85972
+ args: {
85973
+ icType: '1'
85974
+ }
85975
+ });
85976
+ break;
85977
+ case EWindowPassMethodCode.FingerPrint_Base64:
85978
+ // 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
85979
+ jsonString = 'getimgae,1,0,288,0';
85980
+ break;
85981
+ default:
85982
+ jsonString = JSON.stringify({
85983
+ method,
85984
+ args: {
85985
+ outTimes: 30
85986
+ }
85987
+ });
85988
+ break;
85989
+ }
85990
+ this.ws.send(jsonString);
86570
85991
  return new Promise((resolve, reject) => {
86571
85992
  if (!this.requestStore) {
86572
85993
  this.requestStore = [];
@@ -86577,14 +85998,174 @@ class SignReadService {
86577
85998
  });
86578
85999
  });
86579
86000
  } else {
86580
- throw Error('签字板未准备完成');
86001
+ throw Error(methodDesc + '未准备完成');
86002
+ }
86003
+ }
86004
+ /**
86005
+ * 读取二代身份证
86006
+ * */
86007
+ static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
86008
+ const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
86009
+ console.log('读取二代身份证==>', readData);
86010
+ if (!readData) {
86011
+ throw Error('未匹配可用的E窗通读取设备');
86012
+ }
86013
+ if (readData.retVal !== 0) {
86014
+ throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86015
+ }
86016
+ const idInfo = readData.idInfo.data;
86017
+ const {
86018
+ name,
86019
+ sex,
86020
+ birthday,
86021
+ address,
86022
+ id_num,
86023
+ nations
86024
+ } = idInfo;
86025
+ const IDCardData = {
86026
+ info: {
86027
+ name,
86028
+ sex,
86029
+ birthday: birthday.replace('-', '').replace('-', ''),
86030
+ address,
86031
+ cardId: id_num,
86032
+ nation: nations
86033
+ },
86034
+ headImage: readData.idPhotoPicBase64
86035
+ };
86036
+ console.log('读取二代身份证结果==>', IDCardData);
86037
+ return IDCardData;
86038
+ }
86039
+ /**
86040
+ * 人证比对
86041
+ */
86042
+ static async faceValidateWithIdCardRead() {
86043
+ const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
86044
+ console.log('人证比对==>', readData);
86045
+ if (!readData) {
86046
+ throw Error('未匹配可用的E窗通读取设备');
86047
+ }
86048
+ if (readData.retVal !== 0) {
86049
+ throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86050
+ }
86051
+ const idInfo = readData.idInfo.data;
86052
+ const {
86053
+ name,
86054
+ sex,
86055
+ birth,
86056
+ address,
86057
+ idNo,
86058
+ nation
86059
+ } = idInfo;
86060
+ const IDCardData = {
86061
+ idCard: {
86062
+ info: {
86063
+ name,
86064
+ sex,
86065
+ birthday: birth.replace('-', '').replace('-', ''),
86066
+ address,
86067
+ cardId: idNo,
86068
+ nation
86069
+ },
86070
+ headImage: readData.idPhotoBase64
86071
+ },
86072
+ faceimg: readData.scenceBase64
86073
+ };
86074
+ console.log('人证比对结果==>', IDCardData);
86075
+ return IDCardData;
86076
+ }
86077
+ /** 读取社保卡 */
86078
+ static async socialSecurityCardRead() {
86079
+ const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
86080
+ if (!readData) {
86081
+ throw Error('未匹配可用的E窗通读取设备');
86082
+ }
86083
+ if (readData.retVal !== 0) {
86084
+ throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
86085
+ }
86086
+ // 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
86087
+ const outInfo = readData.outInfo;
86088
+ const outInfoArray = outInfo.split('|');
86089
+ const cardId = outInfoArray[1];
86090
+ const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
86091
+ const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
86092
+ const IDCardData = {
86093
+ info: {
86094
+ name: outInfoArray[4],
86095
+ sex,
86096
+ birthday,
86097
+ address: '',
86098
+ cardId
86099
+ },
86100
+ headImage: ''
86101
+ };
86102
+ console.log('读取社保卡==>', readData);
86103
+ return IDCardData;
86104
+ }
86105
+ /** 获取签名-base64 */
86106
+ static async signNameRead() {
86107
+ const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
86108
+ if (!readData) {
86109
+ throw Error('未匹配可用的E窗通读取设备');
86110
+ }
86111
+ if (readData.retVal !== 0) {
86112
+ throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
86113
+ }
86114
+ console.log('获取签名==>', readData);
86115
+ return readData.signPicBase64;
86116
+ }
86117
+ /** 获取指纹*/
86118
+ static async fingerPrintRead() {
86119
+ let timeOver = 30;
86120
+ async function readFingerPrint() {
86121
+ const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
86122
+ if (!readData) {
86123
+ throw Error('未匹配可用的E窗通读取设备');
86124
+ }
86125
+ let list = readData.fingerPrintInfo.split("|");
86126
+ console.log(list);
86127
+ let ret = Number(list[1]);
86128
+ if (ret > 1) {
86129
+ if (timeOver > 0) {
86130
+ timeOver--;
86131
+ return await readFingerPrint();
86132
+ } else {
86133
+ return {
86134
+ status: 'error',
86135
+ data: '已超时,请重新操作,按压指纹'
86136
+ };
86137
+ }
86138
+ } else {
86139
+ return {
86140
+ status: 'success',
86141
+ data: readData.fingerPrintInfo
86142
+ };
86143
+ }
86144
+ }
86145
+ let {
86146
+ status,
86147
+ data
86148
+ } = await readFingerPrint();
86149
+ if (status === 'error') {
86150
+ throw Error(data);
86151
+ } else {
86152
+ let [method, result, quality, image, featureCode] = data.split('|');
86153
+ // getimgae|1|68|......|......
86154
+ // method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
86155
+ return {
86156
+ method,
86157
+ result,
86158
+ quality,
86159
+ image,
86160
+ featureCode
86161
+ };
86581
86162
  }
86582
86163
  }
86583
86164
  }
86584
- _defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chromeManage');
86585
- _defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
86586
- _defineProperty(SignReadService, "ws", void 0);
86587
- _defineProperty(SignReadService, "requestStore", []);
86165
+ _defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
86166
+ _defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
86167
+ _defineProperty(EWindowPassService, "ws", void 0);
86168
+ _defineProperty(EWindowPassService, "requestStore", []);
86588
86169
  ;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
86589
86170
 
86590
86171
 
@@ -87746,8 +87327,8 @@ var default_take_photo_dialog_component = normalizeComponent(
87746
87327
  )
87747
87328
 
87748
87329
  /* harmony default export */ var default_take_photo_dialog = (default_take_photo_dialog_component.exports);
87749
- ;// 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/dialog/wei-rong-face-auth-dialog.vue?vue&type=template&id=d49bc744&scoped=true&
87750
- var wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_render = function render() {
87330
+ ;// 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/dialog/wei-rong-face-auth-dialog.vue?vue&type=template&id=7b54f4e4&scoped=true&
87331
+ var wei_rong_face_auth_dialogvue_type_template_id_7b54f4e4_scoped_true_render = function render() {
87751
87332
  var _vm = this,
87752
87333
  _c = _vm._self._c;
87753
87334
  return _vm.visibility ? _c('el-dialog', {
@@ -87777,11 +87358,11 @@ var wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_render =
87777
87358
  }
87778
87359
  })])]) : _vm._e();
87779
87360
  };
87780
- var wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_staticRenderFns = [];
87361
+ var wei_rong_face_auth_dialogvue_type_template_id_7b54f4e4_scoped_true_staticRenderFns = [];
87781
87362
 
87782
87363
  ;// 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/dialog/wei-rong-face-auth-dialog.vue?vue&type=script&lang=js&
87783
87364
 
87784
-
87365
+ // import { WeiRongPluginService } from '../../../../service/external-plugins/wei-rong-plugin-socket.service'
87785
87366
  const wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA = 'data:image/jpg;base64,';
87786
87367
  /* harmony default export */ var wei_rong_face_auth_dialogvue_type_script_lang_js_ = ({
87787
87368
  name: "wei-rong-face-auth-dialog",
@@ -87792,14 +87373,14 @@ const wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA = 'data:image/
87792
87373
  };
87793
87374
  },
87794
87375
  async created() {
87795
- console.log();
87796
87376
  window.addEventListener(SCANNER_CAMERA_REFRESH_PHOTO_EVENT, message => {
87797
87377
  if (message.type === SCANNER_CAMERA_REFRESH_PHOTO_EVENT) {
87798
87378
  this.viewFaceImage = `${wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA}${message.scannerResultUrl}`;
87799
87379
  }
87800
87380
  });
87801
- let res = await WeiRongPluginService.faceValidateWithIdCardRead();
87802
- this.$message.success('认证成功');
87381
+
87382
+ // let res = await WeiRongPluginService.faceValidateWithIdCardRead();
87383
+ // this.$message.success('认证成功');
87803
87384
  setTimeout(() => {
87804
87385
  this.$emit('close', res);
87805
87386
  }, 1500);
@@ -87817,11 +87398,11 @@ const wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA = 'data:image/
87817
87398
  ;
87818
87399
  var wei_rong_face_auth_dialog_component = normalizeComponent(
87819
87400
  dialog_wei_rong_face_auth_dialogvue_type_script_lang_js_,
87820
- wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_render,
87821
- wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_staticRenderFns,
87401
+ wei_rong_face_auth_dialogvue_type_template_id_7b54f4e4_scoped_true_render,
87402
+ wei_rong_face_auth_dialogvue_type_template_id_7b54f4e4_scoped_true_staticRenderFns,
87822
87403
  false,
87823
87404
  null,
87824
- "d49bc744",
87405
+ "7b54f4e4",
87825
87406
  null
87826
87407
 
87827
87408
  )
@@ -87831,7 +87412,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
87831
87412
 
87832
87413
 
87833
87414
 
87834
-
87415
+ // import { WeiRongPluginService } from '../../../service/external-plugins/wei-rong-plugin-socket.service'
87835
87416
 
87836
87417
 
87837
87418
 
@@ -88007,8 +87588,8 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88007
87588
  this.$emit('click', idcardInfo);
88008
87589
  break;
88009
87590
  case 10:
88010
- idcardInfo = await WeiRongPluginService.idCardRead();
88011
- this.$emit('click', idcardInfo);
87591
+ // idcardInfo = await WeiRongPluginService.idCardRead();
87592
+ // this.$emit('click', idcardInfo)
88012
87593
  break;
88013
87594
  }
88014
87595
  },
@@ -88067,7 +87648,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88067
87648
  idcardInfo = await HuzReadService.socialSecurityCardRead();
88068
87649
  break;
88069
87650
  case 5:
88070
- idcardInfo = await WeiRongPluginService.socialSecurityCardRead();
87651
+ // idcardInfo = await WeiRongPluginService.socialSecurityCardRead();
88071
87652
  break;
88072
87653
  }
88073
87654
  this.$emit('click', idcardInfo);
@@ -88112,7 +87693,7 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88112
87693
  }
88113
87694
  break;
88114
87695
  case 5:
88115
- userSignature = await WeiRongPluginService.signNameRead();
87696
+ // userSignature = await WeiRongPluginService.signNameRead()
88116
87697
  break;
88117
87698
  }
88118
87699
  // 返回base64编码内容,无前缀
@@ -88237,11 +87818,11 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
88237
87818
  ;
88238
87819
  var id_card_reader_button_component = normalizeComponent(
88239
87820
  src_id_card_reader_buttonvue_type_script_lang_js_,
88240
- id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render,
88241
- id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns,
87821
+ id_card_reader_buttonvue_type_template_id_3939400c_scoped_true_render,
87822
+ id_card_reader_buttonvue_type_template_id_3939400c_scoped_true_staticRenderFns,
88242
87823
  false,
88243
87824
  null,
88244
- "19ae37ba",
87825
+ "3939400c",
88245
87826
  null
88246
87827
 
88247
87828
  )