Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-xcmg-vue-app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xugong
hls-xcmg-vue-app
Commits
93e4317c
Commit
93e4317c
authored
Dec 18, 2019
by
李晓兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'活体检测'
parent
6fd8fc82
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
65 deletions
+24
-65
uat.env.js
config/uat.env.js
+1
-1
body-check.vue
src/pages/contractSigning/body-check.vue
+21
-63
hlsUtil.js
src/scripts/hlsUtil.js
+2
-1
No files found.
config/uat.env.js
View file @
93e4317c
...
@@ -10,5 +10,5 @@ module.exports = {
...
@@ -10,5 +10,5 @@ module.exports = {
filePath
:
'"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"'
,
filePath
:
'"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"'
,
ocrPath
:
'"http://180.104.121.66:8088/r/api"'
,
ocrPath
:
'"http://180.104.121.66:8088/r/api"'
,
appId
:
'"com.xcmg.app"'
,
appId
:
'"com.xcmg.app"'
,
currentVersion
:
'"1.1.
3
"'
currentVersion
:
'"1.1.
4
"'
}
}
src/pages/contractSigning/body-check.vue
View file @
93e4317c
...
@@ -77,11 +77,12 @@ export default {
...
@@ -77,11 +77,12 @@ export default {
methods
:
{
methods
:
{
recordVdeo
()
{
// 开始录制
recordVdeo
()
{
// 开始录制
let
vm
=
this
let
vm
=
this
vm
.
downNum
=
false
// 模态框消失
let
onSuccess
=
function
(
mediaFiles
)
{
let
onSuccess
=
function
(
mediaFiles
)
{
// 遍历获取录制的文件(iOS 只支持一次录制一个视频)
// 遍历获取录制的文件(iOS 只支持一次录制一个视频)
/* for (let i = 0; i < mediaFiles.length; i++) {
/* for (let i = 0; i < mediaFiles.length; i++) {
alert('录制成功!\n\n' + '文件名:' + mediaFiles[i].name + '\n' + '大小:' + mediaFiles[i].size + '\n\n' + 'localURL地址:' + mediaFiles[i].localURL + '\n\n' + 'fullPath地址:' + mediaFiles[i].fullPath)
alert('录制成功!\n\n' + '文件名:' + mediaFiles[i].name + '\n' + '大小:' + mediaFiles[i].size + '\n\n' + 'localURL地址:' + mediaFiles[i].localURL + '\n\n' + 'fullPath地址:' + mediaFiles[i].fullPath)
}*/
}
*/
console
.
log
(
'录制成功!
\
n
\
n'
+
'文件名:'
+
mediaFiles
[
0
].
name
+
'
\
n'
+
'大小:'
+
mediaFiles
[
0
].
size
+
'
\
n
\
n'
+
'localURL地址:'
+
mediaFiles
[
0
].
localURL
+
'
\
n
\
n'
+
'fullPath地址:'
+
mediaFiles
[
0
].
fullPath
)
console
.
log
(
'录制成功!
\
n
\
n'
+
'文件名:'
+
mediaFiles
[
0
].
name
+
'
\
n'
+
'大小:'
+
mediaFiles
[
0
].
size
+
'
\
n
\
n'
+
'localURL地址:'
+
mediaFiles
[
0
].
localURL
+
'
\
n
\
n'
+
'fullPath地址:'
+
mediaFiles
[
0
].
fullPath
)
vm
.
succesCall
(
mediaFiles
[
0
].
fullPath
)
vm
.
succesCall
(
mediaFiles
[
0
].
fullPath
)
}
}
...
@@ -91,80 +92,37 @@ export default {
...
@@ -91,80 +92,37 @@ export default {
hlsUtil
.
captureVideo
(
onSuccess
,
onError
)
hlsUtil
.
captureVideo
(
onSuccess
,
onError
)
},
},
/* vm.videoCapture = function () {
document.addEventListener("deviceready", function () {
var options = {};
//平台判断
if (ionic.Platform.isAndroid()) {
options = {
//quality: 1, //0代表低质量压缩,1代表高质量压缩
duration: 5 * 60 * 1000, //控制视频录制长度,当到达这个长度也会停止录制,单位:毫秒
audioBitRate: -2, //视频比特率
audioChannels: 1, //声道数量
audioSampleRate: -2, //采样率
videoBitRate: -4, //音频比特率
maxFileLength: 50, //mb 录制的最大文件大小
videoFrameRate: 24, //帧数 一秒内多少个画面,画面越少越卡,但是文件大小也越小
maxQuality: "MAX_480P" //录频分辨率
};
} else if (ionic.Platform.isIOS()) {
options = {
quality: 1, //0代表低质量压缩,1代表高质量压缩
duration: 120 //控制视频录制长度,当到达这个长度也会停止录制,单位:秒
};
}
navigator.device.capture.captureVideo(onSuccess, onFail, options);
function onSuccess(mediaFiles) {
var mediaFile = mediaFiles[0];
alert("录制成功!" + ",文件名:" + mediaFile.name + ",文件大小:" + mediaFile.size +
",localURL地址:" + mediaFile.localURL + ",fullPath地址:" + mediaFile.fullPath);
if (mediaFile.size > (1024 * 1024 * 50)) {
defer.reject('录制失败,视频大小不能超过50M!');
} else {
mediaFile.desc = 'media';
//alert(mediaFile);
}
}
function onFail(message) {
alert('录制失败' + message);
}
}, false);
}; */
succesCall
(
fileUrl
)
{
// 录制成功后进行检测
succesCall
(
fileUrl
)
{
// 录制成功后进行检测
let
vm
=
this
let
vm
=
this
console
.
log
(
'fileUrl '
+
fileUrl
)
console
.
log
(
'fileUrl '
+
fileUrl
)
console
.
log
(
'sessionId '
+
vm
.
sessionId
)
console
.
log
(
'sessionId '
+
vm
.
sessionId
)
let
url
=
process
.
env
.
ocrPath
+
'/baidu/ocr/videoFaceliveness'
let
url
=
process
.
env
.
ocrPath
+
'/baidu/ocr/videoFaceliveness'
let
param
=
{
let
param
=
{
fileUrl
:
fileUrl
,
fileUrl
:
fileUrl
,
sessionId
:
vm
.
sessionId
,
sessionId
:
vm
.
sessionId
,
}
}
vm
.
hlsPopup
.
showLoading
(
'正在检测'
)
vm
.
hlsPopup
.
showLoading
(
'正在检测'
)
var
flag
=
false
var
loadInterval
=
setInterval
(
function
()
{
vm
.
hlsPopup
.
showLoading
(
'视频过大,请耐心等待'
)
if
(
flag
)
{
vm
.
hlsPopup
.
hideLoading
()
clearInterval
(
loadInterval
)
}
},
5000
)
hlsUtil
.
baiduOcrVideo
(
param
,
url
,
function
(
res
)
{
hlsUtil
.
baiduOcrVideo
(
param
,
url
,
function
(
res
)
{
hlsPopup
.
hideLoading
()
flag
=
true
vm
.
hlsPopup
.
hideLoading
()
console
.
log
(
'##########res '
+
JSON
.
stringify
(
res
))
console
.
log
(
'##########res '
+
JSON
.
stringify
(
res
))
if
(
res
.
result
.
result
.
thresholds
.
frr_1e
-
2
<
0.9
)
{
if
(
res
.
result
.
result
.
thresholds
.
frr_1e
-
2
<
0.9
)
{
vm
.
hlsPopup
.
showLong
c
enter
(
'检测失败,请重新尝试'
)
vm
.
hlsPopup
.
showLong
C
enter
(
'检测失败,请重新尝试'
)
}
else
{
}
else
{
vm
.
hlsPopup
.
showLong
c
enter
(
'检测成功'
)
vm
.
hlsPopup
.
showLong
C
enter
(
'检测成功'
)
}
}
})
})
/* vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result.thresholds.frr_1e-2 < 0.9) {
vm.hlsPopup.showLongcenter('检测失败,请重新尝试')
} else {
vm.hlsPopup.showLongcenter('检测成功')
}
})*/
},
},
getCode
()
{
// 获取验证码
getCode
()
{
// 获取验证码
//this.downNum = true
//
this.downNum = true
this
.
computeTime
()
this
.
computeTime
()
this
.
time
=
60
this
.
time
=
60
this
.
lastTime
=
3
this
.
lastTime
=
3
...
@@ -180,8 +138,8 @@ export default {
...
@@ -180,8 +138,8 @@ export default {
vm
.
downNum
=
true
vm
.
downNum
=
true
}
}
})
})
/*
let str = '098672'
/*
let str = '098672'
vm.codeList = [...str]*/
vm.codeList = [...str]
*/
},
},
computeTime
()
{
// 倒计时
computeTime
()
{
// 倒计时
let
vm
=
this
let
vm
=
this
...
...
src/scripts/hlsUtil.js
View file @
93e4317c
...
@@ -552,7 +552,8 @@ export default {
...
@@ -552,7 +552,8 @@ export default {
}
}
function
error
(
e
)
{
function
error
(
e
)
{
this
.
hlsPopup
.
showLongCenter
(
'识别失败'
)
console
.
log
(
'识别失败'
)
hlsPopup
.
showLongCenter
(
'识别失败'
)
}
}
ft
.
upload
(
path
,
url
,
uploadSuccess
,
error
,
options
)
ft
.
upload
(
path
,
url
,
uploadSuccess
,
error
,
options
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment