Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
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
方斌
51business
Commits
52cd25be
Commit
52cd25be
authored
Sep 06, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
57f911e6
Pipeline
#13430
passed with stage
in 4 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
1 deletion
+48
-1
callrisk.js
app/controller/credit/callrisk.js
+18
-0
helper.js
app/extend/helper.js
+21
-1
callrisk.js
app/service/credit/callrisk.js
+9
-0
No files found.
app/controller/credit/callrisk.js
View file @
52cd25be
...
...
@@ -19,7 +19,25 @@ class CallriskController extends Controller {
async
queryCallRisk
()
{
const
{
ctx
}
=
this
;
const
input_params
=
ctx
.
request
.
body
;
const
{
real_name
,
id_card
,
phone
,
password
}
=
input_params
;
if
(
ctx
.
helper
.
verify_real_name
(
real_name
)
!==
1
)
{
ctx
.
failed
(
'姓名输入有误,请校验后输入'
);
}
if
(
!
ctx
.
helper
.
verify_id_card
(
id_card
))
{
ctx
.
failed
(
'身份证输入有误,请校验后输入'
);
}
if
(
!
ctx
.
helper
.
isPhoneNumber
(
phone
))
{
ctx
.
failed
(
'手机号输入有误,请校验后输入'
);
}
//TODO 三要素校验 调用数据服务接口
}
...
...
app/extend/helper.js
View file @
52cd25be
...
...
@@ -128,7 +128,7 @@ module.exports = {
//longitude 经线 latitude 纬度 纬度从南到北,范围为-90 - 90
//示例:北纬N29°57′28.20″ 东经E119°42′32.30″ gps:29.9578340000,119.7089730000
checkGps
(
gps
)
{
if
(
!
gps
||
gps
.
indexOf
(
','
)
===
-
1
)
{
return
''
;
}
...
...
@@ -278,4 +278,24 @@ module.exports = {
}
},
/**判断是否是手机号**/
isPhoneNumber
(
tel
)
{
var
reg
=
/^0
?
1
[
3|4|5|6|7|8|9
][
0-9
]\d{8}
$/
;
return
reg
.
test
(
tel
);
},
// 0姓名格式不正确;-1至少输入2个汉字 1成功
verify_real_name
(
real_name
)
{
const
real_name_reg
=
/^
[\u
4E00-
\u
9FA5
]{1,10}
$/
;
if
(
!
real_name_reg
.
test
(
real_name
))
{
//姓名校验
return
0
;
}
if
(
real_name
.
length
<
2
)
{
return
-
1
;
}
return
1
;
},
};
app/service/credit/callrisk.js
View file @
52cd25be
...
...
@@ -6,7 +6,16 @@ const moment = require('moment');
class
CallriskService
extends
Service
{
async
checkThreeElements
()
{
}
async
getCallriskDetailData
(
input
)
{
const
{
real_name
,
id_card
,
phone
,
password
}
=
input
;
//TODO 调用运营商数据接口
return
{};
}
/**
* 获取个人通话检测报告
...
...
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