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
891fd168
Commit
891fd168
authored
Oct 19, 2018
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注册即修改密码
parent
9218aa7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+4
-1
PasswordUtil.java
src/main/java/cn/quantgroup/xyqb/util/PasswordUtil.java
+5
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
891fd168
...
...
@@ -267,7 +267,10 @@ public class UserController implements IBaseController {
registerFrom
=
1L
;
}
verifyPhoneAndCode
(
phoneNo
,
verificationCode
);
if
(
userService
.
exist
(
phoneNo
))
{
User
user
=
userService
.
findByPhoneInDb
(
phoneNo
);
if
(
user
!=
null
)
{
user
.
setPassword
(
PasswordUtil
.
MD5WithSalt
(
password
));
userService
.
saveUser
(
user
);
log
.
info
(
"用户注册失败,该手机号已经被注册:register -> registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
//已存在的用户, 经过短信认证, 也认为是注册成功的
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
...
...
src/main/java/cn/quantgroup/xyqb/util/PasswordUtil.java
View file @
891fd168
package
cn
.
quantgroup
.
xyqb
.
util
;
import
cn.quantgroup.xyqb.Constants
;
import
com.google.common.base.Preconditions
;
import
java.security.MessageDigest
;
...
...
@@ -20,6 +21,10 @@ public class PasswordUtil {
'x'
,
'y'
,
'z'
,
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
};
public
final
static
String
MD5WithSalt
(
String
s
){
return
MD5
(
s
.
toLowerCase
()
+
Constants
.
PASSWORD_SALT
);
}
public
final
static
String
MD5
(
String
s
)
{
try
{
byte
[]
strTemp
=
s
.
getBytes
(
"utf-8"
);
...
...
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