Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1-office-web-sit
Commits
7e3274e6
Commit
7e3274e6
authored
Dec 10, 2021
by
唐功亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】 密码字段改为pass
parent
0e874f33
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
4 deletions
+45
-4
MemberDao.java
src/main/java/io/office/modules/manage/dao/MemberDao.java
+4
-1
LogLoginServiceImpl.java
...fice/modules/manage/service/impl/LogLoginServiceImpl.java
+36
-1
MemberServiceImpl.java
...office/modules/manage/service/impl/MemberServiceImpl.java
+5
-2
No files found.
src/main/java/io/office/modules/manage/dao/MemberDao.java
View file @
7e3274e6
...
...
@@ -21,6 +21,9 @@ public interface MemberDao extends BaseMapper<MemberEntity> {
@Select
(
"select * from member where username=#{userName}"
)
MemberEntity
selectByName
(
@Param
(
"userName"
)
String
userName
);
@Update
(
"UPDATE member SET pass
word
= #{passWord} WHERE id = #{id}"
)
@Update
(
"UPDATE member SET pass = #{passWord} WHERE id = #{id}"
)
void
updateByIdPassWord
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"passWord"
)
String
passWord
);
/*@Select("select * from member where username=#{userName} or firmcode=#{userName}")
MemberEntity selectByNameAndSn(@Param("userName") String userName);*/
}
src/main/java/io/office/modules/manage/service/impl/LogLoginServiceImpl.java
View file @
7e3274e6
...
...
@@ -10,6 +10,8 @@ import org.springframework.stereotype.Service;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.regex.Pattern
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
...
@@ -29,8 +31,10 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
@Autowired
private
LogLoginDao
logLoginDao
;
@Autowired
private
MemberDao
memberDao
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
LogLoginEntity
>
page
=
this
.
page
(
...
...
@@ -41,6 +45,8 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
return
new
PageUtils
(
page
);
}
@Override
public
void
login
(
Map
<
String
,
Object
>
params
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
userName
=
String
.
valueOf
(
params
.
get
(
"userName"
)==
null
?
""
:
params
.
get
(
"userName"
));
...
...
@@ -48,10 +54,25 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
String
verification
=
String
.
valueOf
(
params
.
get
(
"verification"
)==
null
?
""
:
params
.
get
(
"verification"
));
//验证码
//session中获取验证码
//判断 验证码是否正确
//判断用户是否是手机号 是手机号调用 第三方接口登录 不是继续
int
userType
;
//1.业务大厅 2.网站用户
if
(
matchPhoneNumber
(
userName
)){
//TODO tgl 调用第三方登录接口
userType
=
1
;
}
else
{
userType
=
2
;
//查询Member表
MemberEntity
memberEntity
=
memberDao
.
selectByName
(
userName
);
//用户类型 www:为官网用户 条码卡:为条码卡用户
String
source
=
memberEntity
.
getSource
();
if
(!
"条码卡"
.
equals
(
source
)){
//官网用户
}
}
MemberEntity
user
=
memberDao
.
selectByName
(
userName
);
String
phone
=
user
.
getPhone
();
String
password
=
user
.
getPass
word
();
String
password
=
user
.
getPass
();
String
passwordMD5
=
MD5Util
.
md5Encrypt32Upper
(
passWord
);
//判断密码是否正确
if
(!
passwordMD5
.
equals
(
password
)){
...
...
@@ -60,4 +81,17 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
//TODO tgl 参数不正确添加登录日志 log_login
logLoginDao
.
insert
(
new
LogLoginEntity
(
1
,
userName
,
"用户来源"
,
"条码卡号"
,
phone
,
new
Date
(),
IPUtils
.
getIpAddr
(
request
),
request
.
getRequestURL
().
toString
()));
}
/**
* 验证手机号 由于号码段不断的更新,只需要判断手机号有11位,并且全是数字以及1开头等
* @param phoneNumber 手机号码
* @return
*/
private
static
boolean
matchPhoneNumber
(
String
phoneNumber
)
{
String
regex
=
"1[358][0-9]{9}"
;
if
(
phoneNumber
==
null
||
phoneNumber
.
length
()<=
0
){
return
false
;
}
return
Pattern
.
matches
(
regex
,
phoneNumber
);
}
}
\ No newline at end of file
src/main/java/io/office/modules/manage/service/impl/MemberServiceImpl.java
View file @
7e3274e6
...
...
@@ -77,8 +77,11 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
String
subjoinReq
=
request
.
getSession
().
getAttribute
(
"subjoin"
)==
null
?
""
:
String
.
valueOf
(
request
.
getSession
().
getAttribute
(
"subjoin"
));
String
telReq
=
request
.
getSession
().
getAttribute
(
"tel"
)==
null
?
""
:
String
.
valueOf
(
request
.
getSession
().
getAttribute
(
"tel"
));
Long
dateReq
=
request
.
getSession
().
getAttribute
(
"date"
)==
null
?
0
:
Long
.
valueOf
(
String
.
valueOf
(
request
.
getSession
().
getAttribute
(
"date"
)));
//毫秒值
subjoinReq
=
"344942"
;
telReq
=
"13159872863"
;
long
l
=
System
.
currentTimeMillis
();
dateReq
=(
l
-
dateReq
)/
1000
;
//dateReq=(l-dateReq)/1000;
dateReq
=
30L
;
//获取验证码验证次数
TimescodeRegiEntity
timescodeRegiEntity
=
timescodeRegiDao
.
selectById
(
phone
);
if
(
timescodeRegiEntity
==
null
){
...
...
@@ -92,7 +95,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
MemberEntity
memberEntity
=
new
MemberEntity
();
memberEntity
.
setUsername
(
userName
);
//MD5加密密码
memberEntity
.
setPass
word
(
MD5Util
.
md5Encrypt32Upper
(
passWord
));
memberEntity
.
setPass
(
MD5Util
.
md5Encrypt32Upper
(
passWord
));
memberEntity
.
setEmail
(
emiail
);
memberEntity
.
setPhone
(
phone
);
memberEntity
.
setOicq
(
""
);
...
...
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