Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
Aidea
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
sa_aidea
Aidea
Commits
c82fee50
Commit
c82fee50
authored
Mar 21, 2021
by
谢希宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Submit by Strive
Date 2021/03/21 替换身份证验证方式
parent
2215e2d5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
72 deletions
+70
-72
authenticationform.html
...bapp/WEB-INF/views/authentication/authenticationform.html
+66
-68
productBatchlist.html
...c/main/webapp/WEB-INF/views/product/productBatchlist.html
+2
-2
MemberMapper.xml
...dule/src/main/java/com/cftech/member/dao/MemberMapper.xml
+1
-1
MpFanssMapper.xml
...le/src/main/java/com/cftech/mp/fans/dao/MpFanssMapper.xml
+1
-1
No files found.
aidea-modules/authentication-module-web/src/main/webapp/WEB-INF/views/authentication/authenticationform.html
View file @
c82fee50
...
...
@@ -194,94 +194,51 @@
submitHandler
:
function
(
form
)
{
var
card
=
$
(
"#idCard"
).
val
();
var
reg
=
/
(
^
\d{15}
$
)
|
(
^
\d{17}(\d
|X
)
$
)
/
;
if
(
reg
.
test
(
card
)
==
false
)
{
let
result
=
IdCodeValid
(
card
)
;
if
(
!
result
)
{
Cfapp
.
alert
({
message
:
"
请输入正确格式的身份证号码
"
,
message
:
"
身份证格式错误
"
,
btntext
:
"确定"
,
success
:
function
()
{
}
success
:
function
()
{}
});
}
else
{
return
;
}
//身份证正则表达式(18位)
var
isIdCard2
=
/^
[
1-9
]\d{5}(
19
\d{2}
|
[
2-9
]\d{3})((
0
\d)
|
(
1
[
0-2
]))(([
0|1|2
]\d)
|3
[
0-1
])(\d{4}
|
\d{3}
X
)
$/i
;
var
stard
=
"10X98765432"
;
//最后一位身份证的号码
var
first
=
[
7
,
9
,
10
,
5
,
8
,
4
,
2
,
1
,
6
,
3
,
7
,
9
,
10
,
5
,
8
,
4
,
2
];
//1-17系数
var
sum
=
0
;
if
(
!
isIdCard2
.
test
(
card
))
{
Cfapp
.
alert
({
message
:
"请输入正确格式的身份证号码
"
,
btn
text
:
"确定
"
,
//保存
$
(
"#save"
).
attr
(
"disabled"
,
true
)
;
$
.
getJSON
(
"#springUrl('/a/authentication/formData')"
,
$
(
"#myForm"
).
serialize
(),
function
(
returnobj
)
{
$
(
"#save"
).
attr
(
"disabled"
,
false
);
if
(
returnobj
.
errorNo
==
2
)
{
//保存成功
Cfapp
.
confirm
(
{
message
:
"添加成功"
,
btnoktext
:
"继续添加
"
,
btn
canceltext
:
"关闭
"
,
success
:
function
()
{
location
.
href
=
"#springUrl('/a/authentication/form')"
;
},
cancel
:
function
()
{
location
.
href
=
"#springUrl('/a/authentication/list')"
;
}
});
return
;
}
var
year
=
card
.
substr
(
6
,
4
);
var
month
=
card
.
substr
(
10
,
2
);
var
day
=
card
.
substr
(
12
,
2
);
var
birthday
=
card
.
substr
(
6
,
8
);
if
(
birthday
!=
dateToString
(
new
Date
(
year
+
'/'
+
month
+
'/'
+
day
)))
{
//校验日期是否合法
}
else
if
(
returnobj
.
errorNo
==
0
)
{
//修改成功
Cfapp
.
alert
({
message
:
"
请输入正确格式的身份证号码
"
,
message
:
"
更新成功
"
,
btntext
:
"确定"
,
success
:
function
()
{
}
});
return
;
}
for
(
var
i
=
0
;
i
<
card
.
length
-
1
;
i
++
)
{
sum
+=
card
[
i
]
*
first
[
i
];
}
var
result
=
sum
%
11
;
var
last
=
stard
[
result
];
//计算出来的最后一位身份证号码
if
(
card
[
card
.
length
-
1
].
toUpperCase
()
==
last
)
{
//保存
$
(
"#save"
).
attr
(
"disabled"
,
true
);
$
.
getJSON
(
"#springUrl('/a/authentication/formData')"
,
$
(
"#myForm"
).
serialize
(),
function
(
returnobj
)
{
$
(
"#save"
).
attr
(
"disabled"
,
false
);
if
(
returnobj
.
errorNo
==
2
)
{
//保存成功
Cfapp
.
confirm
({
message
:
"添加成功"
,
btnoktext
:
"继续添加"
,
btncanceltext
:
"关闭"
,
success
:
function
()
{
location
.
href
=
"#springUrl('/a/authentication/form')"
;
},
cancel
:
function
()
{
location
.
href
=
"#springUrl('/a/authentication/list')"
;
}
});
}
else
if
(
returnobj
.
errorNo
==
0
)
{
//修改成功
Cfapp
.
alert
({
message
:
"更新成功"
,
btntext
:
"确定"
,
success
:
function
()
{
location
.
href
=
"#springUrl('/a/authentication/list')"
;
}
});
}
else
{
Cfapp
.
alert
({
message
:
"创建失败"
,
btntext
:
"确定"
,
success
:
function
()
{
location
.
href
=
"#springUrl('/a/authentication/list')"
;
}
});
location
.
href
=
"#springUrl('/a/authentication/list')"
;
}
});
}
else
{
Cfapp
.
alert
({
message
:
"
请输入正确格式的身份证号码
"
,
message
:
"
创建失败
"
,
btntext
:
"确定"
,
success
:
function
()
{
location
.
href
=
"#springUrl('/a/authentication/list')"
;
}
});
return
;
}
});
}
}
...
...
@@ -298,6 +255,47 @@
};
}();
function
IdCodeValid
(
code
)
{
//身份证号合法性验证
//支持15位和18位身份证号
//支持地址编码、出生日期、校验位验证
var
city
=
{
11
:
"北京"
,
12
:
"天津"
,
13
:
"河北"
,
14
:
"山西"
,
15
:
"内蒙古"
,
21
:
"辽宁"
,
22
:
"吉林"
,
23
:
"黑龙江 "
,
31
:
"上海"
,
32
:
"江苏"
,
33
:
"浙江"
,
34
:
"安徽"
,
35
:
"福建"
,
36
:
"江西"
,
37
:
"山东"
,
41
:
"河南"
,
42
:
"湖北 "
,
43
:
"湖南"
,
44
:
"广东"
,
45
:
"广西"
,
46
:
"海南"
,
50
:
"重庆"
,
51
:
"四川"
,
52
:
"贵州"
,
53
:
"云南"
,
54
:
"西藏 "
,
61
:
"陕西"
,
62
:
"甘肃"
,
63
:
"青海"
,
64
:
"宁夏"
,
65
:
"新疆"
,
71
:
"台湾"
,
81
:
"香港"
,
82
:
"澳门"
,
91
:
"国外 "
};
var
row
=
true
;
var
msg
=
"验证成功"
;
if
(
!
code
||
!
/^
\d{6}(
18|19|20
)?\d{2}(
0
[
1-9
]
|1
[
012
])(
0
[
1-9
]
|
[
12
]\d
|3
[
01
])\d{3}(\d
|
[
xX
])
$/
.
test
(
code
)){
row
=
false
,
msg
=
"被保人身份证号格式错误"
;
}
else
if
(
!
city
[
code
.
substr
(
0
,
2
)]){
row
=
false
,
msg
=
"被保人身份证号地址编码错误"
;
}
else
{
//18位身份证需要验证最后一位校验位
if
(
code
.
length
==
18
){
code
=
code
.
split
(
''
);
//∑(ai×Wi)(mod 11)
//加权因子
var
factor
=
[
7
,
9
,
10
,
5
,
8
,
4
,
2
,
1
,
6
,
3
,
7
,
9
,
10
,
5
,
8
,
4
,
2
];
//校验位
var
parity
=
[
1
,
0
,
'X'
,
9
,
8
,
7
,
6
,
5
,
4
,
3
,
2
];
var
sum
=
0
;
var
ai
=
0
;
var
wi
=
0
;
for
(
var
i
=
0
;
i
<
17
;
i
++
)
{
ai
=
code
[
i
];
wi
=
factor
[
i
];
sum
+=
ai
*
wi
;
}
if
(
parity
[
sum
%
11
]
!=
code
[
17
].
toUpperCase
()){
row
=
false
,
msg
=
"被保人身份证号校验位错误"
;
}
}
}
return
row
;
}
</script>
</body>
<!-- END BODY -->
...
...
aidea-modules/product-module-web/src/main/webapp/WEB-INF/views/product/productBatchlist.html
View file @
c82fee50
...
...
@@ -91,8 +91,8 @@
<div
class=
"col-xs-2"
>
<select
id=
"status"
name=
"status"
class=
"form-control pull-right"
>
<option
value=
""
>
请选择状态
</option>
<option
value=
"0"
>
否
</option>
<option
value=
"1"
>
是
</option>
<option
value=
"0"
>
已失效
</option>
<option
value=
"1"
>
已激活
</option>
</select>
</div>
...
...
membercard-modules/member-module/src/main/java/com/cftech/member/dao/MemberMapper.xml
View file @
c82fee50
...
...
@@ -79,7 +79,7 @@
<sql
id=
"sqlColumnslist"
>
id,
number,
CONVERT(AES_DECRYPT(name,'aideakey') USING UTF8) name
,
CONVERT(AES_DECRYPT(name,'aideakey') USING UTF8) name,
CONVERT(AES_DECRYPT(phone,'aideakey') USING UTF8) phone,
imageurl,
cardid,
...
...
mp-modules/mp-fanss-module/src/main/java/com/cftech/mp/fans/dao/MpFanssMapper.xml
View file @
c82fee50
...
...
@@ -90,7 +90,7 @@
<!-- 插入用户服务号 -->
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.cftech.mp.fans.model.MpFanssEntity"
>
insert into wx_mp_fanss (
openid, nickname,
insert into wx_mp_fanss (openid, nickname,
sex,city,province,country,delflag,headimgurl,
subscribetime,createtime,timestamp,updatetime,mpaccountid,userid,taglist,status,recommender,store,source,description,unionid)
values (#{openid,jdbcType=VARCHAR},
...
...
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