Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
65bf7039
Commit
65bf7039
authored
Jul 03, 2019
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
变更:
1、不允许空密码用户通过账密登陆 2、无密码注册不再设置默认密码
parent
5ab5e81d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+12
-1
UserRegisterServiceImpl.java
...p/xyqb/service/register/impl/UserRegisterServiceImpl.java
+3
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
65bf7039
...
...
@@ -480,8 +480,19 @@ public class UserController implements IBaseController {
return
user
;
}
/**
* 账密登陆
*
* @param paramPass 不允许空密码
* @param targetPassword
* @return
*/
private
boolean
validatePassword
(
String
paramPass
,
String
targetPassword
)
{
return
StringUtils
.
defaultString
(
targetPassword
,
""
).
equals
(
PasswordUtil
.
MD5
(
paramPass
.
toLowerCase
()
+
Constants
.
PASSWORD_SALT
));
if
(
StringUtils
.
isBlank
(
paramPass
)){
return
false
;
}
String
thePassword
=
PasswordUtil
.
MD5
(
paramPass
.
toLowerCase
()
+
Constants
.
PASSWORD_SALT
);
return
Objects
.
equals
(
thePassword
,
targetPassword
);
}
private
JsonResult
loginWithUserId
(
Long
channelId
,
String
appChannel
,
Long
createdFrom
,
String
userId
,
Merchant
merchant
,
String
dimension
,
HttpServletRequest
request
)
{
...
...
src/main/java/cn/quantgroup/xyqb/service/register/impl/UserRegisterServiceImpl.java
View file @
65bf7039
...
...
@@ -74,7 +74,9 @@ public class UserRegisterServiceImpl implements IUserRegisterService {
if
(
userRegisterParam
.
isGenerateRandomPwd
())
{
password
=
PasswordUtil
.
generateRandomPwd
(
Constants
.
RANDOM_PWD_LEN
);
}
user
.
setPassword
(
PasswordUtil
.
MD5
(
password
.
toLowerCase
()
+
Constants
.
PASSWORD_SALT
));
if
(
StringUtils
.
isNotBlank
(
password
)){
user
.
setPassword
(
PasswordUtil
.
MD5WithSalt
(
password
));
}
Timestamp
currentTime
=
new
Timestamp
(
System
.
currentTimeMillis
());
user
.
setUpdatedAt
(
currentTime
);
user
.
setCreatedAt
(
currentTime
);
...
...
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