unify-external-plugin-platform 0.0.2-68 → 0.0.2-69
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.
- package/dist/external-plugin.common.js +1029 -478
- package/dist/external-plugin.common.js.map +1 -1
- package/dist/external-plugin.css +1 -1
- package/dist/external-plugin.umd.js +1029 -478
- package/dist/external-plugin.umd.js.map +1 -1
- package/dist/external-plugin.umd.min.js +3 -3
- package/dist/external-plugin.umd.min.js.map +1 -1
- package/package.json +1 -1
@@ -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=
|
84023
|
-
var
|
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() {
|
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_65e6d7b8_scoped_true_render = f
|
|
84084
84084
|
}, [_vm._v(_vm._s(item.label))]), _vm._t("action")];
|
84085
84085
|
})], 2)])]);
|
84086
84086
|
};
|
84087
|
-
var
|
84087
|
+
var scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_staticRenderFns = [];
|
84088
84088
|
|
84089
84089
|
;// CONCATENATED MODULE: ./packages/utils/custom-axios.ts
|
84090
84090
|
/**
|
@@ -84994,12 +84994,764 @@ 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);
|
84997
85748
|
;// 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&
|
84998
85749
|
|
84999
85750
|
|
85000
85751
|
|
85001
85752
|
|
85002
85753
|
|
85754
|
+
|
85003
85755
|
const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/jpg;base64,';
|
85004
85756
|
/* harmony default export */ var scanner_camera_componentvue_type_script_lang_js_ = ({
|
85005
85757
|
name: "scanner-camera-component",
|
@@ -85085,6 +85837,13 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
|
|
85085
85837
|
this.$emit('send-scanner-result', `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${res}`);
|
85086
85838
|
break;
|
85087
85839
|
}
|
85840
|
+
case 6:
|
85841
|
+
{
|
85842
|
+
// 国产客户端一体机
|
85843
|
+
let res = await WeiRongPluginService.scanByCamera();
|
85844
|
+
this.$emit('send-scanner-result', `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${res}`);
|
85845
|
+
break;
|
85846
|
+
}
|
85088
85847
|
}
|
85089
85848
|
},
|
85090
85849
|
/**
|
@@ -85108,6 +85867,10 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
|
|
85108
85867
|
// 良田高拍仪
|
85109
85868
|
this.scannerVideoSrc = eloam_plugin_service_ELoamPassService.mainCameraUrl;
|
85110
85869
|
break;
|
85870
|
+
case 6:
|
85871
|
+
// 国产客户端一体机
|
85872
|
+
await WeiRongPluginService.turnOnTheCamera();
|
85873
|
+
break;
|
85111
85874
|
}
|
85112
85875
|
},
|
85113
85876
|
/**
|
@@ -85131,6 +85894,10 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
|
|
85131
85894
|
// 良田
|
85132
85895
|
this.scannerVideoSrc = eloam_plugin_service_ELoamPassService.secondaryCameraUrl;
|
85133
85896
|
break;
|
85897
|
+
case 6:
|
85898
|
+
// 国产客户端一体机
|
85899
|
+
await WeiRongPluginService.turnOnTheCamera();
|
85900
|
+
break;
|
85134
85901
|
}
|
85135
85902
|
},
|
85136
85903
|
handleAction(name) {
|
@@ -85153,10 +85920,10 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
|
|
85153
85920
|
});
|
85154
85921
|
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
|
85155
85922
|
/* harmony default export */ var component_scanner_camera_componentvue_type_script_lang_js_ = (scanner_camera_componentvue_type_script_lang_js_);
|
85156
|
-
;// 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=
|
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&
|
85157
85924
|
// extracted by mini-css-extract-plugin
|
85158
85925
|
|
85159
|
-
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=
|
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&
|
85160
85927
|
|
85161
85928
|
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue
|
85162
85929
|
|
@@ -85169,11 +85936,11 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
|
|
85169
85936
|
|
85170
85937
|
var scanner_camera_component_component = normalizeComponent(
|
85171
85938
|
component_scanner_camera_componentvue_type_script_lang_js_,
|
85172
|
-
|
85173
|
-
|
85939
|
+
scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_render,
|
85940
|
+
scanner_camera_componentvue_type_template_id_bc9cce92_scoped_true_staticRenderFns,
|
85174
85941
|
false,
|
85175
85942
|
null,
|
85176
|
-
"
|
85943
|
+
"bc9cce92",
|
85177
85944
|
null
|
85178
85945
|
|
85179
85946
|
)
|
@@ -85468,8 +86235,8 @@ id_card_reader_eloam.install = Vue => {
|
|
85468
86235
|
Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
|
85469
86236
|
};
|
85470
86237
|
/* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
|
85471
|
-
;// 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=
|
85472
|
-
var
|
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() {
|
85473
86240
|
var _vm = this,
|
85474
86241
|
_c = _vm._self._c;
|
85475
86242
|
return _vm.tip ? _c('el-tooltip', {
|
@@ -85546,7 +86313,7 @@ var id_card_reader_buttonvue_type_template_id_5b90b226_scoped_true_render = func
|
|
85546
86313
|
}
|
85547
86314
|
})], 2);
|
85548
86315
|
};
|
85549
|
-
var
|
86316
|
+
var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns = [];
|
85550
86317
|
|
85551
86318
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
|
85552
86319
|
|
@@ -85566,191 +86333,24 @@ var PluginApiType;
|
|
85566
86333
|
PluginApiType["camera"] = "sxt";
|
85567
86334
|
/**有为签字 */
|
85568
86335
|
PluginApiType["ywSign"] = "yw";
|
85569
|
-
/**汉王签字 */
|
85570
|
-
PluginApiType["hwSign"] = "hwsign";
|
85571
|
-
})(PluginApiType || (PluginApiType = {}));
|
85572
|
-
class IdCardReadService {
|
85573
|
-
// 精伦身份证 JLSFZManage
|
85574
|
-
// 之前 SFZManage
|
85575
|
-
|
85576
|
-
static startConnect(type = PluginApiType.idcard) {
|
85577
|
-
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85578
|
-
return this;
|
85579
|
-
}
|
85580
|
-
let webSocketUrl = this.idcardWebSocketUrl;
|
85581
|
-
switch (type) {
|
85582
|
-
case PluginApiType.idcard:
|
85583
|
-
webSocketUrl = this.idcardWebSocketUrl;
|
85584
|
-
break;
|
85585
|
-
case PluginApiType.jlsfz:
|
85586
|
-
webSocketUrl = this.jlsfzWebSocketUrl;
|
85587
|
-
}
|
85588
|
-
const ws = new WebSocket(webSocketUrl);
|
85589
|
-
let resolved;
|
85590
|
-
const onConnect = new Promise(resolve => {
|
85591
|
-
resolved = resolve;
|
85592
|
-
});
|
85593
|
-
ws.onopen = () => {
|
85594
|
-
resolved(true);
|
85595
|
-
};
|
85596
|
-
ws.onmessage = event => this.handleMessage(event);
|
85597
|
-
ws.onclose = () => this.handleClose();
|
85598
|
-
ws.onerror = () => this.handleError();
|
85599
|
-
this.ws = ws;
|
85600
|
-
return onConnect;
|
85601
|
-
}
|
85602
|
-
static handleError() {
|
85603
|
-
for (const type in this.requestStore) {
|
85604
|
-
this.requestStore.forEach(({
|
85605
|
-
reject
|
85606
|
-
}) => {
|
85607
|
-
reject('handleError');
|
85608
|
-
});
|
85609
|
-
}
|
85610
|
-
throw Error('读取身份证功能加载失败');
|
85611
|
-
}
|
85612
|
-
static handleClose() {
|
85613
|
-
for (const type in this.requestStore) {
|
85614
|
-
this.requestStore.forEach(({
|
85615
|
-
reject
|
85616
|
-
}) => {
|
85617
|
-
reject('close');
|
85618
|
-
});
|
85619
|
-
}
|
85620
|
-
}
|
85621
|
-
static handleMessage(msg) {
|
85622
|
-
let data = '';
|
85623
|
-
try {
|
85624
|
-
data = JSON.parse(msg.data);
|
85625
|
-
} catch (e) {
|
85626
|
-
data = '';
|
85627
|
-
}
|
85628
|
-
this.requestStore.forEach(({
|
85629
|
-
resolve
|
85630
|
-
}) => {
|
85631
|
-
resolve(data);
|
85632
|
-
});
|
85633
|
-
this.requestStore = [];
|
85634
|
-
this.ws.close();
|
85635
|
-
}
|
85636
|
-
static async read(type = PluginApiType.idcard) {
|
85637
|
-
await this.startConnect(type);
|
85638
|
-
if (this.ws.readyState === 1) {
|
85639
|
-
this.ws.send(type);
|
85640
|
-
return new Promise((resolve, reject) => {
|
85641
|
-
if (!this.requestStore) {
|
85642
|
-
this.requestStore = [];
|
85643
|
-
}
|
85644
|
-
this.requestStore.push({
|
85645
|
-
resolve,
|
85646
|
-
reject
|
85647
|
-
});
|
85648
|
-
});
|
85649
|
-
} else {
|
85650
|
-
throw Error('读取身份证未准备完成');
|
85651
|
-
}
|
85652
|
-
}
|
85653
|
-
static async idCardCommonRead() {
|
85654
|
-
let idcardInfo;
|
85655
|
-
// 顺序不要调整,先连接精伦读卡器,最后连接普通读卡器(也就是PluginApiType.idcard,因为该项读卡失败不会返回消息)
|
85656
|
-
for (const t of [PluginApiType.jlsfz, PluginApiType.idcard]) {
|
85657
|
-
const readData = await IdCardReadService.read(t);
|
85658
|
-
if (readData && readData.hasOwnProperty('info')) {
|
85659
|
-
idcardInfo = readData;
|
85660
|
-
break;
|
85661
|
-
}
|
85662
|
-
}
|
85663
|
-
if (idcardInfo) {
|
85664
|
-
return idcardInfo;
|
85665
|
-
} else {
|
85666
|
-
throw Error('未匹配可用的读卡器');
|
85667
|
-
}
|
85668
|
-
}
|
85669
|
-
}
|
85670
|
-
_defineProperty(IdCardReadService, "idcardWebSocketUrl", 'ws://127.0.0.1:8152/SFZManage');
|
85671
|
-
_defineProperty(IdCardReadService, "jlsfzWebSocketUrl", 'ws://127.0.0.1:8152/JLSFZManage');
|
85672
|
-
_defineProperty(IdCardReadService, "ws", void 0);
|
85673
|
-
_defineProperty(IdCardReadService, "requestStore", []);
|
85674
|
-
class CameraReadService {
|
85675
|
-
static startConnect() {
|
85676
|
-
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85677
|
-
return this;
|
85678
|
-
}
|
85679
|
-
let webSocketUrl = this.cameraWebSocketUrl;
|
85680
|
-
const ws = new WebSocket(webSocketUrl);
|
85681
|
-
let resolved;
|
85682
|
-
const onConnect = new Promise(resolve => {
|
85683
|
-
resolved = resolve;
|
85684
|
-
});
|
85685
|
-
ws.onopen = () => {
|
85686
|
-
resolved(true);
|
85687
|
-
};
|
85688
|
-
ws.onmessage = event => this.handleMessage(event);
|
85689
|
-
ws.onclose = () => this.handleClose();
|
85690
|
-
ws.onerror = () => this.handleError();
|
85691
|
-
this.ws = ws;
|
85692
|
-
return onConnect;
|
85693
|
-
}
|
85694
|
-
static handleError() {
|
85695
|
-
for (const type in this.requestStore) {
|
85696
|
-
this.requestStore.forEach(({
|
85697
|
-
reject
|
85698
|
-
}) => {
|
85699
|
-
reject('handleError');
|
85700
|
-
});
|
85701
|
-
}
|
85702
|
-
throw Error('读取拍照功能加载失败');
|
85703
|
-
}
|
85704
|
-
static handleClose() {
|
85705
|
-
for (const type in this.requestStore) {
|
85706
|
-
this.requestStore.forEach(({
|
85707
|
-
reject
|
85708
|
-
}) => {
|
85709
|
-
reject('close');
|
85710
|
-
});
|
85711
|
-
}
|
85712
|
-
}
|
85713
|
-
static handleMessage(msg) {
|
85714
|
-
let data = msg.data;
|
85715
|
-
this.requestStore.forEach(({
|
85716
|
-
resolve
|
85717
|
-
}) => {
|
85718
|
-
resolve(data);
|
85719
|
-
});
|
85720
|
-
this.requestStore = [];
|
85721
|
-
this.ws.close();
|
85722
|
-
// this.ws = null;
|
85723
|
-
}
|
86336
|
+
/**汉王签字 */
|
86337
|
+
PluginApiType["hwSign"] = "hwsign";
|
86338
|
+
})(PluginApiType || (PluginApiType = {}));
|
86339
|
+
class IdCardReadService {
|
86340
|
+
// 精伦身份证 JLSFZManage
|
86341
|
+
// 之前 SFZManage
|
85724
86342
|
|
85725
|
-
static
|
85726
|
-
await this.startConnect();
|
85727
|
-
if (this.ws.readyState === 1) {
|
85728
|
-
this.ws.send(PluginApiType.camera);
|
85729
|
-
return new Promise((resolve, reject) => {
|
85730
|
-
if (!this.requestStore) {
|
85731
|
-
this.requestStore = [];
|
85732
|
-
}
|
85733
|
-
this.requestStore.push({
|
85734
|
-
resolve,
|
85735
|
-
reject
|
85736
|
-
});
|
85737
|
-
});
|
85738
|
-
} else {
|
85739
|
-
throw Error('读取拍照未准备完成');
|
85740
|
-
}
|
85741
|
-
}
|
85742
|
-
}
|
85743
|
-
_defineProperty(CameraReadService, "cameraWebSocketUrl", 'ws://127.0.0.1:8152/SXTManage');
|
85744
|
-
_defineProperty(CameraReadService, "ws", void 0);
|
85745
|
-
_defineProperty(CameraReadService, "requestStore", []);
|
85746
|
-
class SignReadService {
|
85747
|
-
static startConnect(signMode) {
|
86343
|
+
static startConnect(type = PluginApiType.idcard) {
|
85748
86344
|
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85749
86345
|
return this;
|
85750
86346
|
}
|
85751
|
-
let webSocketUrl = this.
|
85752
|
-
|
85753
|
-
|
86347
|
+
let webSocketUrl = this.idcardWebSocketUrl;
|
86348
|
+
switch (type) {
|
86349
|
+
case PluginApiType.idcard:
|
86350
|
+
webSocketUrl = this.idcardWebSocketUrl;
|
86351
|
+
break;
|
86352
|
+
case PluginApiType.jlsfz:
|
86353
|
+
webSocketUrl = this.jlsfzWebSocketUrl;
|
85754
86354
|
}
|
85755
86355
|
const ws = new WebSocket(webSocketUrl);
|
85756
86356
|
let resolved;
|
@@ -85774,7 +86374,7 @@ class SignReadService {
|
|
85774
86374
|
reject('handleError');
|
85775
86375
|
});
|
85776
86376
|
}
|
85777
|
-
throw Error('
|
86377
|
+
throw Error('读取身份证功能加载失败');
|
85778
86378
|
}
|
85779
86379
|
static handleClose() {
|
85780
86380
|
for (const type in this.requestStore) {
|
@@ -85786,7 +86386,12 @@ class SignReadService {
|
|
85786
86386
|
}
|
85787
86387
|
}
|
85788
86388
|
static handleMessage(msg) {
|
85789
|
-
let data =
|
86389
|
+
let data = '';
|
86390
|
+
try {
|
86391
|
+
data = JSON.parse(msg.data);
|
86392
|
+
} catch (e) {
|
86393
|
+
data = '';
|
86394
|
+
}
|
85790
86395
|
this.requestStore.forEach(({
|
85791
86396
|
resolve
|
85792
86397
|
}) => {
|
@@ -85795,11 +86400,10 @@ class SignReadService {
|
|
85795
86400
|
this.requestStore = [];
|
85796
86401
|
this.ws.close();
|
85797
86402
|
}
|
85798
|
-
static async read(
|
85799
|
-
await this.startConnect(
|
86403
|
+
static async read(type = PluginApiType.idcard) {
|
86404
|
+
await this.startConnect(type);
|
85800
86405
|
if (this.ws.readyState === 1) {
|
85801
|
-
|
85802
|
-
this.ws.send(signMode);
|
86406
|
+
this.ws.send(type);
|
85803
86407
|
return new Promise((resolve, reject) => {
|
85804
86408
|
if (!this.requestStore) {
|
85805
86409
|
this.requestStore = [];
|
@@ -85810,57 +86414,36 @@ class SignReadService {
|
|
85810
86414
|
});
|
85811
86415
|
});
|
85812
86416
|
} else {
|
85813
|
-
throw Error('
|
86417
|
+
throw Error('读取身份证未准备完成');
|
86418
|
+
}
|
86419
|
+
}
|
86420
|
+
static async idCardCommonRead() {
|
86421
|
+
let idcardInfo;
|
86422
|
+
// 顺序不要调整,先连接精伦读卡器,最后连接普通读卡器(也就是PluginApiType.idcard,因为该项读卡失败不会返回消息)
|
86423
|
+
for (const t of [PluginApiType.jlsfz, PluginApiType.idcard]) {
|
86424
|
+
const readData = await IdCardReadService.read(t);
|
86425
|
+
if (readData && readData.hasOwnProperty('info')) {
|
86426
|
+
idcardInfo = readData;
|
86427
|
+
break;
|
86428
|
+
}
|
86429
|
+
}
|
86430
|
+
if (idcardInfo) {
|
86431
|
+
return idcardInfo;
|
86432
|
+
} else {
|
86433
|
+
throw Error('未匹配可用的读卡器');
|
85814
86434
|
}
|
85815
86435
|
}
|
85816
86436
|
}
|
85817
|
-
_defineProperty(
|
85818
|
-
_defineProperty(
|
85819
|
-
_defineProperty(
|
85820
|
-
_defineProperty(
|
85821
|
-
|
85822
|
-
|
85823
|
-
|
85824
|
-
/**
|
85825
|
-
* 沃斯德人证交互终端
|
85826
|
-
* E窗通WEBSOCKET服务
|
85827
|
-
*
|
85828
|
-
* */
|
85829
|
-
|
85830
|
-
var EWindowPassMethodCode;
|
85831
|
-
(function (EWindowPassMethodCode) {
|
85832
|
-
/** 读取社保卡 */
|
85833
|
-
EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
|
85834
|
-
/** 获取签名*/
|
85835
|
-
EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
|
85836
|
-
/** 读取二代身份证 */
|
85837
|
-
EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
|
85838
|
-
/** 人证比对 */
|
85839
|
-
EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
|
85840
|
-
/** 获取指纹 */
|
85841
|
-
EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
|
85842
|
-
})(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
|
85843
|
-
const EWindowPassMethodDesc = {
|
85844
|
-
[EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
|
85845
|
-
[EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
|
85846
|
-
[EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
|
85847
|
-
[EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
|
85848
|
-
[EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
|
85849
|
-
};
|
85850
|
-
class EWindowPassService {
|
85851
|
-
static startConnect(method) {
|
86437
|
+
_defineProperty(IdCardReadService, "idcardWebSocketUrl", 'ws://127.0.0.1:8152/SFZManage');
|
86438
|
+
_defineProperty(IdCardReadService, "jlsfzWebSocketUrl", 'ws://127.0.0.1:8152/JLSFZManage');
|
86439
|
+
_defineProperty(IdCardReadService, "ws", void 0);
|
86440
|
+
_defineProperty(IdCardReadService, "requestStore", []);
|
86441
|
+
class CameraReadService {
|
86442
|
+
static startConnect() {
|
85852
86443
|
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85853
86444
|
return this;
|
85854
86445
|
}
|
85855
|
-
let webSocketUrl =
|
85856
|
-
switch (method) {
|
85857
|
-
case EWindowPassMethodCode.FingerPrint_Base64:
|
85858
|
-
webSocketUrl = this.fingerPrintBasWebSocketUrl;
|
85859
|
-
break;
|
85860
|
-
default:
|
85861
|
-
webSocketUrl = this.iReadCardBasWebSocketUrl;
|
85862
|
-
break;
|
85863
|
-
}
|
86446
|
+
let webSocketUrl = this.cameraWebSocketUrl;
|
85864
86447
|
const ws = new WebSocket(webSocketUrl);
|
85865
86448
|
let resolved;
|
85866
86449
|
const onConnect = new Promise(resolve => {
|
@@ -85869,18 +86452,7 @@ class EWindowPassService {
|
|
85869
86452
|
ws.onopen = () => {
|
85870
86453
|
resolved(true);
|
85871
86454
|
};
|
85872
|
-
ws.onmessage = event =>
|
85873
|
-
if (method === EWindowPassMethodCode.FingerPrint_Base64) {
|
85874
|
-
// 指纹后端返回的是string
|
85875
|
-
event = {
|
85876
|
-
...event,
|
85877
|
-
data: JSON.stringify({
|
85878
|
-
fingerPrintInfo: event.data
|
85879
|
-
})
|
85880
|
-
};
|
85881
|
-
}
|
85882
|
-
this.handleMessage(event);
|
85883
|
-
};
|
86455
|
+
ws.onmessage = event => this.handleMessage(event);
|
85884
86456
|
ws.onclose = () => this.handleClose();
|
85885
86457
|
ws.onerror = () => this.handleError();
|
85886
86458
|
this.ws = ws;
|
@@ -85894,7 +86466,7 @@ class EWindowPassService {
|
|
85894
86466
|
reject('handleError');
|
85895
86467
|
});
|
85896
86468
|
}
|
85897
|
-
throw Error('
|
86469
|
+
throw Error('读取拍照功能加载失败');
|
85898
86470
|
}
|
85899
86471
|
static handleClose() {
|
85900
86472
|
for (const type in this.requestStore) {
|
@@ -85906,12 +86478,7 @@ class EWindowPassService {
|
|
85906
86478
|
}
|
85907
86479
|
}
|
85908
86480
|
static handleMessage(msg) {
|
85909
|
-
let data =
|
85910
|
-
try {
|
85911
|
-
data = JSON.parse(msg.data);
|
85912
|
-
} catch (e) {
|
85913
|
-
data = '';
|
85914
|
-
}
|
86481
|
+
let data = msg.data;
|
85915
86482
|
this.requestStore.forEach(({
|
85916
86483
|
resolve
|
85917
86484
|
}) => {
|
@@ -85919,237 +86486,105 @@ class EWindowPassService {
|
|
85919
86486
|
});
|
85920
86487
|
this.requestStore = [];
|
85921
86488
|
this.ws.close();
|
86489
|
+
// this.ws = null;
|
85922
86490
|
}
|
85923
|
-
|
85924
|
-
|
85925
|
-
|
86491
|
+
|
86492
|
+
static async read() {
|
86493
|
+
await this.startConnect();
|
85926
86494
|
if (this.ws.readyState === 1) {
|
85927
|
-
|
85928
|
-
let jsonString;
|
85929
|
-
// outTimes:超时时间(秒)
|
85930
|
-
switch (method) {
|
85931
|
-
case EWindowPassMethodCode.ReadIDCard_Base64:
|
85932
|
-
// cardReader:0 读卡器-USB;1 读卡器-COM
|
85933
|
-
jsonString = JSON.stringify({
|
85934
|
-
method,
|
85935
|
-
args: {
|
85936
|
-
outTimes: 30,
|
85937
|
-
cardReader: 1
|
85938
|
-
}
|
85939
|
-
});
|
85940
|
-
break;
|
85941
|
-
case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
|
85942
|
-
// cardReader:0 读卡器-USB;1 读卡器-COM
|
85943
|
-
jsonString = JSON.stringify({
|
85944
|
-
method,
|
85945
|
-
args: {
|
85946
|
-
outTimes: 30,
|
85947
|
-
cardReader: 1,
|
85948
|
-
cameraType: 0
|
85949
|
-
}
|
85950
|
-
});
|
85951
|
-
break;
|
85952
|
-
case EWindowPassMethodCode.iReadCardBas:
|
85953
|
-
// icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
|
85954
|
-
jsonString = JSON.stringify({
|
85955
|
-
method,
|
85956
|
-
args: {
|
85957
|
-
icType: '1'
|
85958
|
-
}
|
85959
|
-
});
|
85960
|
-
break;
|
85961
|
-
case EWindowPassMethodCode.FingerPrint_Base64:
|
85962
|
-
// 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
|
85963
|
-
jsonString = 'getimgae,1,0,288,0';
|
85964
|
-
break;
|
85965
|
-
default:
|
85966
|
-
jsonString = JSON.stringify({
|
85967
|
-
method,
|
85968
|
-
args: {
|
85969
|
-
outTimes: 30
|
85970
|
-
}
|
85971
|
-
});
|
85972
|
-
break;
|
85973
|
-
}
|
85974
|
-
this.ws.send(jsonString);
|
86495
|
+
this.ws.send(PluginApiType.camera);
|
85975
86496
|
return new Promise((resolve, reject) => {
|
85976
86497
|
if (!this.requestStore) {
|
85977
86498
|
this.requestStore = [];
|
85978
86499
|
}
|
85979
86500
|
this.requestStore.push({
|
85980
86501
|
resolve,
|
85981
|
-
reject
|
85982
|
-
});
|
85983
|
-
});
|
85984
|
-
} else {
|
85985
|
-
throw Error(
|
85986
|
-
}
|
85987
|
-
}
|
85988
|
-
/**
|
85989
|
-
* 读取二代身份证
|
85990
|
-
* */
|
85991
|
-
static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
|
85992
|
-
const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
|
85993
|
-
console.log('读取二代身份证==>', readData);
|
85994
|
-
if (!readData) {
|
85995
|
-
throw Error('未匹配可用的E窗通读取设备');
|
85996
|
-
}
|
85997
|
-
if (readData.retVal !== 0) {
|
85998
|
-
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85999
|
-
}
|
86000
|
-
const idInfo = readData.idInfo.data;
|
86001
|
-
const {
|
86002
|
-
name,
|
86003
|
-
sex,
|
86004
|
-
birthday,
|
86005
|
-
address,
|
86006
|
-
id_num,
|
86007
|
-
nations
|
86008
|
-
} = idInfo;
|
86009
|
-
const IDCardData = {
|
86010
|
-
info: {
|
86011
|
-
name,
|
86012
|
-
sex,
|
86013
|
-
birthday: birthday.replace('-', '').replace('-', ''),
|
86014
|
-
address,
|
86015
|
-
cardId: id_num,
|
86016
|
-
nation: nations
|
86017
|
-
},
|
86018
|
-
headImage: readData.idPhotoPicBase64
|
86019
|
-
};
|
86020
|
-
console.log('读取二代身份证结果==>', IDCardData);
|
86021
|
-
return IDCardData;
|
86022
|
-
}
|
86023
|
-
/**
|
86024
|
-
* 人证比对
|
86025
|
-
*/
|
86026
|
-
static async faceValidateWithIdCardRead() {
|
86027
|
-
const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
|
86028
|
-
console.log('人证比对==>', readData);
|
86029
|
-
if (!readData) {
|
86030
|
-
throw Error('未匹配可用的E窗通读取设备');
|
86031
|
-
}
|
86032
|
-
if (readData.retVal !== 0) {
|
86033
|
-
throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
86502
|
+
reject
|
86503
|
+
});
|
86504
|
+
});
|
86505
|
+
} else {
|
86506
|
+
throw Error('读取拍照未准备完成');
|
86034
86507
|
}
|
86035
|
-
const idInfo = readData.idInfo.data;
|
86036
|
-
const {
|
86037
|
-
name,
|
86038
|
-
sex,
|
86039
|
-
birth,
|
86040
|
-
address,
|
86041
|
-
idNo,
|
86042
|
-
nation
|
86043
|
-
} = idInfo;
|
86044
|
-
const IDCardData = {
|
86045
|
-
idCard: {
|
86046
|
-
info: {
|
86047
|
-
name,
|
86048
|
-
sex,
|
86049
|
-
birthday: birth.replace('-', '').replace('-', ''),
|
86050
|
-
address,
|
86051
|
-
cardId: idNo,
|
86052
|
-
nation
|
86053
|
-
},
|
86054
|
-
headImage: readData.idPhotoBase64
|
86055
|
-
},
|
86056
|
-
faceimg: readData.scenceBase64
|
86057
|
-
};
|
86058
|
-
console.log('人证比对结果==>', IDCardData);
|
86059
|
-
return IDCardData;
|
86060
86508
|
}
|
86061
|
-
|
86062
|
-
|
86063
|
-
|
86064
|
-
|
86065
|
-
|
86509
|
+
}
|
86510
|
+
_defineProperty(CameraReadService, "cameraWebSocketUrl", 'ws://127.0.0.1:8152/SXTManage');
|
86511
|
+
_defineProperty(CameraReadService, "ws", void 0);
|
86512
|
+
_defineProperty(CameraReadService, "requestStore", []);
|
86513
|
+
class SignReadService {
|
86514
|
+
static startConnect(signMode) {
|
86515
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
86516
|
+
return this;
|
86066
86517
|
}
|
86067
|
-
|
86068
|
-
|
86518
|
+
let webSocketUrl = this.signWebSocketUrl;
|
86519
|
+
if (signMode === PluginApiType.hwSign) {
|
86520
|
+
webSocketUrl = this.hwSignWebSocketUrl;
|
86069
86521
|
}
|
86070
|
-
|
86071
|
-
|
86072
|
-
const
|
86073
|
-
|
86074
|
-
|
86075
|
-
|
86076
|
-
|
86077
|
-
info: {
|
86078
|
-
name: outInfoArray[4],
|
86079
|
-
sex,
|
86080
|
-
birthday,
|
86081
|
-
address: '',
|
86082
|
-
cardId
|
86083
|
-
},
|
86084
|
-
headImage: ''
|
86522
|
+
const ws = new WebSocket(webSocketUrl);
|
86523
|
+
let resolved;
|
86524
|
+
const onConnect = new Promise(resolve => {
|
86525
|
+
resolved = resolve;
|
86526
|
+
});
|
86527
|
+
ws.onopen = () => {
|
86528
|
+
resolved(true);
|
86085
86529
|
};
|
86086
|
-
|
86087
|
-
|
86530
|
+
ws.onmessage = event => this.handleMessage(event);
|
86531
|
+
ws.onclose = () => this.handleClose();
|
86532
|
+
ws.onerror = () => this.handleError();
|
86533
|
+
this.ws = ws;
|
86534
|
+
return onConnect;
|
86088
86535
|
}
|
86089
|
-
|
86090
|
-
|
86091
|
-
|
86092
|
-
|
86093
|
-
|
86536
|
+
static handleError() {
|
86537
|
+
for (const type in this.requestStore) {
|
86538
|
+
this.requestStore.forEach(({
|
86539
|
+
reject
|
86540
|
+
}) => {
|
86541
|
+
reject('handleError');
|
86542
|
+
});
|
86094
86543
|
}
|
86095
|
-
|
86096
|
-
|
86544
|
+
throw Error('签字板加载失败');
|
86545
|
+
}
|
86546
|
+
static handleClose() {
|
86547
|
+
for (const type in this.requestStore) {
|
86548
|
+
this.requestStore.forEach(({
|
86549
|
+
reject
|
86550
|
+
}) => {
|
86551
|
+
reject('close');
|
86552
|
+
});
|
86097
86553
|
}
|
86098
|
-
console.log('获取签名==>', readData);
|
86099
|
-
return readData.signPicBase64;
|
86100
86554
|
}
|
86101
|
-
|
86102
|
-
|
86103
|
-
|
86104
|
-
|
86105
|
-
|
86106
|
-
|
86107
|
-
|
86108
|
-
|
86109
|
-
|
86110
|
-
|
86111
|
-
|
86112
|
-
|
86113
|
-
|
86114
|
-
|
86115
|
-
|
86116
|
-
|
86117
|
-
|
86118
|
-
|
86119
|
-
data: '已超时,请重新操作,按压指纹'
|
86120
|
-
};
|
86555
|
+
static handleMessage(msg) {
|
86556
|
+
let data = msg.data;
|
86557
|
+
this.requestStore.forEach(({
|
86558
|
+
resolve
|
86559
|
+
}) => {
|
86560
|
+
resolve(data);
|
86561
|
+
});
|
86562
|
+
this.requestStore = [];
|
86563
|
+
this.ws.close();
|
86564
|
+
}
|
86565
|
+
static async read(signMode = PluginApiType.ywSign) {
|
86566
|
+
await this.startConnect(signMode);
|
86567
|
+
if (this.ws.readyState === 1) {
|
86568
|
+
console.log('签字板连接成功');
|
86569
|
+
this.ws.send(signMode);
|
86570
|
+
return new Promise((resolve, reject) => {
|
86571
|
+
if (!this.requestStore) {
|
86572
|
+
this.requestStore = [];
|
86121
86573
|
}
|
86122
|
-
|
86123
|
-
|
86124
|
-
|
86125
|
-
|
86126
|
-
|
86127
|
-
}
|
86128
|
-
}
|
86129
|
-
let {
|
86130
|
-
status,
|
86131
|
-
data
|
86132
|
-
} = await readFingerPrint();
|
86133
|
-
if (status === 'error') {
|
86134
|
-
throw Error(data);
|
86574
|
+
this.requestStore.push({
|
86575
|
+
resolve,
|
86576
|
+
reject
|
86577
|
+
});
|
86578
|
+
});
|
86135
86579
|
} else {
|
86136
|
-
|
86137
|
-
// getimgae|1|68|......|......
|
86138
|
-
// method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
|
86139
|
-
return {
|
86140
|
-
method,
|
86141
|
-
result,
|
86142
|
-
quality,
|
86143
|
-
image,
|
86144
|
-
featureCode
|
86145
|
-
};
|
86580
|
+
throw Error('签字板未准备完成');
|
86146
86581
|
}
|
86147
86582
|
}
|
86148
86583
|
}
|
86149
|
-
_defineProperty(
|
86150
|
-
_defineProperty(
|
86151
|
-
_defineProperty(
|
86152
|
-
_defineProperty(
|
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", []);
|
86153
86588
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
|
86154
86589
|
|
86155
86590
|
|
@@ -87311,6 +87746,87 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87311
87746
|
)
|
87312
87747
|
|
87313
87748
|
/* 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() {
|
87751
|
+
var _vm = this,
|
87752
|
+
_c = _vm._self._c;
|
87753
|
+
return _vm.visibility ? _c('el-dialog', {
|
87754
|
+
staticClass: "wei-rong-face-auth-dialog",
|
87755
|
+
attrs: {
|
87756
|
+
"title": "人脸识别",
|
87757
|
+
"top": '5vh',
|
87758
|
+
"width": "640px",
|
87759
|
+
"visible": _vm.visibility,
|
87760
|
+
"close-on-click-modal": false
|
87761
|
+
},
|
87762
|
+
on: {
|
87763
|
+
"update:visible": function ($event) {
|
87764
|
+
_vm.visibility = $event;
|
87765
|
+
}
|
87766
|
+
}
|
87767
|
+
}, [_c('div', {
|
87768
|
+
staticClass: "image-container"
|
87769
|
+
}, [_c('img', {
|
87770
|
+
staticStyle: {
|
87771
|
+
"width": "600px",
|
87772
|
+
"height": "450px"
|
87773
|
+
},
|
87774
|
+
attrs: {
|
87775
|
+
"id": "photo",
|
87776
|
+
"src": _vm.viewFaceImage
|
87777
|
+
}
|
87778
|
+
})])]) : _vm._e();
|
87779
|
+
};
|
87780
|
+
var wei_rong_face_auth_dialogvue_type_template_id_d49bc744_scoped_true_staticRenderFns = [];
|
87781
|
+
|
87782
|
+
;// 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
|
+
|
87784
|
+
|
87785
|
+
const wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA = 'data:image/jpg;base64,';
|
87786
|
+
/* harmony default export */ var wei_rong_face_auth_dialogvue_type_script_lang_js_ = ({
|
87787
|
+
name: "wei-rong-face-auth-dialog",
|
87788
|
+
data: () => {
|
87789
|
+
return {
|
87790
|
+
visibility: true,
|
87791
|
+
viewFaceImage: ''
|
87792
|
+
};
|
87793
|
+
},
|
87794
|
+
async created() {
|
87795
|
+
console.log();
|
87796
|
+
window.addEventListener(SCANNER_CAMERA_REFRESH_PHOTO_EVENT, message => {
|
87797
|
+
if (message.type === SCANNER_CAMERA_REFRESH_PHOTO_EVENT) {
|
87798
|
+
this.viewFaceImage = `${wei_rong_face_auth_dialogvue_type_script_lang_js_BEGIN_DATA}${message.scannerResultUrl}`;
|
87799
|
+
}
|
87800
|
+
});
|
87801
|
+
let res = await WeiRongPluginService.faceValidateWithIdCardRead();
|
87802
|
+
this.$message.success('认证成功');
|
87803
|
+
setTimeout(() => {
|
87804
|
+
this.$emit('close', res);
|
87805
|
+
}, 1500);
|
87806
|
+
}
|
87807
|
+
});
|
87808
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/wei-rong-face-auth-dialog.vue?vue&type=script&lang=js&
|
87809
|
+
/* harmony default export */ var dialog_wei_rong_face_auth_dialogvue_type_script_lang_js_ = (wei_rong_face_auth_dialogvue_type_script_lang_js_);
|
87810
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/wei-rong-face-auth-dialog.vue
|
87811
|
+
|
87812
|
+
|
87813
|
+
|
87814
|
+
|
87815
|
+
|
87816
|
+
/* normalize component */
|
87817
|
+
;
|
87818
|
+
var wei_rong_face_auth_dialog_component = normalizeComponent(
|
87819
|
+
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,
|
87822
|
+
false,
|
87823
|
+
null,
|
87824
|
+
"d49bc744",
|
87825
|
+
null
|
87826
|
+
|
87827
|
+
)
|
87828
|
+
|
87829
|
+
/* harmony default export */ var wei_rong_face_auth_dialog = (wei_rong_face_auth_dialog_component.exports);
|
87314
87830
|
;// 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&
|
87315
87831
|
|
87316
87832
|
|
@@ -87325,6 +87841,8 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87325
87841
|
|
87326
87842
|
|
87327
87843
|
|
87844
|
+
|
87845
|
+
|
87328
87846
|
/* harmony default export */ var id_card_reader_buttonvue_type_script_lang_js_ = ({
|
87329
87847
|
name: 'id-card-reader-button',
|
87330
87848
|
props: {
|
@@ -87372,10 +87890,10 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87372
87890
|
type: Boolean
|
87373
87891
|
},
|
87374
87892
|
/**
|
87375
|
-
* 读卡器:0-默认读卡器及精伦读卡器;1-丽水一体机;2-沃斯德人证交互终端;3-中正人脸识别;4-华大读卡器;5-良田;6-捷宇信息交互终端;7-太极云软/Z300;8-华视电子读卡器;9
|
87376
|
-
* 人脸识别:0-默认人脸识别(拍照);1-丽水一体机 2-沃斯德人证交互终端;3-中正人脸识别;5-良田;6
|
87377
|
-
* 读取社保卡:2-沃斯德人证交互终端;4
|
87378
|
-
* 签字版:0-有为签字版;1-汉王签字版;2-沃斯德人证交互终端签字;3-捷宇信息交互终端;4-太极云软签字/P-300;
|
87893
|
+
* 读卡器:0-默认读卡器及精伦读卡器;1-丽水一体机;2-沃斯德人证交互终端;3-中正人脸识别;4-华大读卡器;5-良田;6-捷宇信息交互终端;7-太极云软/Z300;8-华视电子读卡器;9-捷宇高拍仪读卡; 10-国产客户端一体机
|
87894
|
+
* 人脸识别:0-默认人脸识别(拍照);1-丽水一体机 2-沃斯德人证交互终端;3-中正人脸识别;5-良田;6-捷宇信息交互终端;10-国产客户端一体机
|
87895
|
+
* 读取社保卡:2-沃斯德人证交互终端;4-华大读卡器;5-国产客户端一体机
|
87896
|
+
* 签字版:0-有为签字版;1-汉王签字版;2-沃斯德人证交互终端签字;3-捷宇信息交互终端;4-太极云软签字/P-300;5:国产客户端签字版
|
87379
87897
|
*/
|
87380
87898
|
readMachineType: {
|
87381
87899
|
default: 0,
|
@@ -87488,6 +88006,10 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87488
88006
|
idcardInfo = await JieYueService.idCardReadByScanner();
|
87489
88007
|
this.$emit('click', idcardInfo);
|
87490
88008
|
break;
|
88009
|
+
case 10:
|
88010
|
+
idcardInfo = await WeiRongPluginService.idCardRead();
|
88011
|
+
this.$emit('click', idcardInfo);
|
88012
|
+
break;
|
87491
88013
|
}
|
87492
88014
|
},
|
87493
88015
|
/**
|
@@ -87526,6 +88048,9 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87526
88048
|
this.$emit('click', data);
|
87527
88049
|
break;
|
87528
88050
|
}
|
88051
|
+
case 10:
|
88052
|
+
this.openWEIRONGFaceValidateDialog();
|
88053
|
+
break;
|
87529
88054
|
}
|
87530
88055
|
},
|
87531
88056
|
/**
|
@@ -87541,6 +88066,9 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87541
88066
|
case 4:
|
87542
88067
|
idcardInfo = await HuzReadService.socialSecurityCardRead();
|
87543
88068
|
break;
|
88069
|
+
case 5:
|
88070
|
+
idcardInfo = await WeiRongPluginService.socialSecurityCardRead();
|
88071
|
+
break;
|
87544
88072
|
}
|
87545
88073
|
this.$emit('click', idcardInfo);
|
87546
88074
|
} catch (e) {
|
@@ -87583,6 +88111,9 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87583
88111
|
userSignature = SignName0;
|
87584
88112
|
}
|
87585
88113
|
break;
|
88114
|
+
case 5:
|
88115
|
+
userSignature = await WeiRongPluginService.signNameRead();
|
88116
|
+
break;
|
87586
88117
|
}
|
87587
88118
|
// 返回base64编码内容,无前缀
|
87588
88119
|
this.$emit('click', userSignature);
|
@@ -87614,6 +88145,26 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87614
88145
|
parent: this
|
87615
88146
|
}).$mount(modalNode);
|
87616
88147
|
},
|
88148
|
+
openWEIRONGFaceValidateDialog() {
|
88149
|
+
console.log('打开人脸识别弹框');
|
88150
|
+
const modalNode = document.createElement('div');
|
88151
|
+
document.body.appendChild(modalNode);
|
88152
|
+
const vm = new (external_commonjs_vue_commonjs2_vue_root_Vue_default())({
|
88153
|
+
render: h => {
|
88154
|
+
return h(wei_rong_face_auth_dialog, {
|
88155
|
+
props: {},
|
88156
|
+
on: {
|
88157
|
+
close: data => {
|
88158
|
+
this.$emit('click', data);
|
88159
|
+
vm.$destroy();
|
88160
|
+
vm.$el.remove();
|
88161
|
+
}
|
88162
|
+
}
|
88163
|
+
});
|
88164
|
+
},
|
88165
|
+
parent: this
|
88166
|
+
}).$mount(modalNode);
|
88167
|
+
},
|
87617
88168
|
/** 良田拍照*/
|
87618
88169
|
readFacePhotoByELoam() {
|
87619
88170
|
const modalNode = document.createElement('div');
|
@@ -87686,11 +88237,11 @@ var default_take_photo_dialog_component = normalizeComponent(
|
|
87686
88237
|
;
|
87687
88238
|
var id_card_reader_button_component = normalizeComponent(
|
87688
88239
|
src_id_card_reader_buttonvue_type_script_lang_js_,
|
87689
|
-
|
87690
|
-
|
88240
|
+
id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render,
|
88241
|
+
id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_staticRenderFns,
|
87691
88242
|
false,
|
87692
88243
|
null,
|
87693
|
-
"
|
88244
|
+
"19ae37ba",
|
87694
88245
|
null
|
87695
88246
|
|
87696
88247
|
)
|