Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
53e57198
Commit
53e57198
authored
Apr 27, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
7b8ecb53
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
bpo-web/app/base/api/impl/yzcontractApi.js
+8
-1
bpo-web/app/base/utils/idcardClient.js
+14
-1
No files found.
bpo-web/app/base/api/impl/yzcontractApi.js
View file @
53e57198
...
@@ -134,7 +134,7 @@ class YZContractApi {
...
@@ -134,7 +134,7 @@ class YZContractApi {
if
(
!
param
.
idNo
)
{
if
(
!
param
.
idNo
)
{
return
this
.
returnjson
(
-
1
,
"请提供代理人身份证号"
);
return
this
.
returnjson
(
-
1
,
"请提供代理人身份证号"
);
}
}
var
cludes
=
[
"13"
,
"17"
,
"19"
];
var
cludes
=
[
"13"
,
"17"
,
"1
8"
,
"1
9"
];
if
(
!
cludes
.
includes
(
param
.
idType
)){
if
(
!
cludes
.
includes
(
param
.
idType
)){
return
this
.
returnjson
(
-
1
,
"个人证件类型错误"
);
return
this
.
returnjson
(
-
1
,
"个人证件类型错误"
);
}
}
...
@@ -169,6 +169,13 @@ class YZContractApi {
...
@@ -169,6 +169,13 @@ class YZContractApi {
return
this
.
returnjson
(
-
1
,
"港澳居民来往内地通行证号码不合规"
);
return
this
.
returnjson
(
-
1
,
"港澳居民来往内地通行证号码不合规"
);
}
}
}
}
if
(
param
.
idType
==
18
){
if
(
!
await
this
.
idcardClient
.
isTWCard
(
param
.
idNo
))
{
return
this
.
returnjson
(
-
1
,
"台湾居民来往大陆通行证号码不合规"
);
}
}
if
(
!
param
.
nonceStr
)
{
if
(
!
param
.
nonceStr
)
{
return
this
.
returnjson
(
-
1
,
"请提供随机码"
);
return
this
.
returnjson
(
-
1
,
"请提供随机码"
);
}
}
...
...
bpo-web/app/base/utils/idcardClient.js
View file @
53e57198
...
@@ -184,7 +184,20 @@ class IdcardClient {
...
@@ -184,7 +184,20 @@ class IdcardClient {
}
}
}
}
}
async
isTWCard
(
card
)
{
// 台湾居民来往大陆通行证
// 规则: 新版8位或18位数字, 旧版10位数字 + 英文字母
// 样本: 12345678 或 1234567890B
var
reg
=
/^
\d{8}
|^
[
a-zA-Z0-9
]{10}
|^
\d{18}
$/
;
if
(
reg
.
test
(
card
)
===
false
)
{
return
false
;
}
else
{
return
true
;
}
}
}
module
.
exports
=
IdcardClient
;
module
.
exports
=
IdcardClient
;
...
...
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