Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
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
曲欣亮
member-api
Commits
f3d0d8cf
Commit
f3d0d8cf
authored
Nov 01, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
找回密码BUG
parent
e5b7393e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletion
+11
-1
MemberOpenApiController.java
...va/com/egolm/film/api/member/MemberOpenApiController.java
+7
-1
Common.java
src/main/java/com/egolm/film/util/Common.java
+2
-0
messages_en_US.properties
src/main/resources/i18n/messages_en_US.properties
+1
-0
messages_zh_CN.properties
src/main/resources/i18n/messages_zh_CN.properties
+1
-0
No files found.
src/main/java/com/egolm/film/api/member/MemberOpenApiController.java
View file @
f3d0d8cf
...
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpSession;
...
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpSession;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.dao.EmptyResultDataAccessException
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -83,7 +84,12 @@ public class MemberOpenApiController {
...
@@ -83,7 +84,12 @@ public class MemberOpenApiController {
XException
.
assertNotBlank
(
messages
.
get
(
"err.email_null"
),
email
);
XException
.
assertNotBlank
(
messages
.
get
(
"err.email_null"
),
email
);
int
code
=
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
10000000
);
int
code
=
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
10000000
);
String
password
=
String
.
valueOf
(
code
);
String
password
=
String
.
valueOf
(
code
);
Fc_member
member
=
memberService
.
getMemberByEmail
(
email
);
Fc_member
member
=
null
;
try
{
member
=
memberService
.
getMemberByEmail
(
email
);
}
catch
(
EmptyResultDataAccessException
e
)
{
throw
new
XException
(
messages
.
get
(
"err.user_not_exists"
));
}
String
encodePwd
=
Common
.
encodePassword
(
password
,
member
.
getSalt
());
String
encodePwd
=
Common
.
encodePassword
(
password
,
member
.
getSalt
());
memberService
.
resetPassword
(
member
.
getId
(),
encodePwd
);
memberService
.
resetPassword
(
member
.
getId
(),
encodePwd
);
String
name
=
member
.
getUsername
();
String
name
=
member
.
getUsername
();
...
...
src/main/java/com/egolm/film/util/Common.java
View file @
f3d0d8cf
...
@@ -23,5 +23,7 @@ public class Common {
...
@@ -23,5 +23,7 @@ public class Common {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
encodePassword
(
"123456"
,
"5e0vt0"
));
System
.
out
.
println
(
encodePassword
(
"123456"
,
"5e0vt0"
));
System
.
out
.
println
(
getGenerateString
(
6
));
}
}
}
}
src/main/resources/i18n/messages_en_US.properties
View file @
f3d0d8cf
...
@@ -7,6 +7,7 @@ err.user_disabled=User disabled
...
@@ -7,6 +7,7 @@ err.user_disabled=User disabled
err.user_pwd_err
=
User or password error
err.user_pwd_err
=
User or password error
err.user_pwd_null
=
User and passowrd can not be null
err.user_pwd_null
=
User and passowrd can not be null
err.user_exists
=
User already exists
err.user_exists
=
User already exists
err.user_not_exists
=
User does not exists
err.email_null
=
The mailbox can not be empty
err.email_null
=
The mailbox can not be empty
err.name_null
=
The username can not be empty
err.name_null
=
The username can not be empty
err.pwd_null
=
The password can not be empty
err.pwd_null
=
The password can not be empty
...
...
src/main/resources/i18n/messages_zh_CN.properties
View file @
f3d0d8cf
...
@@ -7,6 +7,7 @@ err.user_disabled=\u7528\u6237\u5DF2\u7ECF\u7981\u7528
...
@@ -7,6 +7,7 @@ err.user_disabled=\u7528\u6237\u5DF2\u7ECF\u7981\u7528
err.user_pwd_err=
\u7528\u6237\u6216\u
5BC6
\u7801\u9519\u
8BEF
err.user_pwd_err=
\u7528\u6237\u6216\u
5BC6
\u7801\u9519\u
8BEF
err.user_pwd_null
=
\u7528\u6237\u
540D
\u
548C
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.user_pwd_null
=
\u7528\u6237\u
540D
\u
548C
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.user_exists
=
\u7528\u6237\u
5DF2
\u
5B58
\u5728
err.user_exists
=
\u7528\u6237\u
5DF2
\u
5B58
\u5728
err.user_not_exists=
\u7528\u6237\u
4E0D
\u
5B58
\u5728
err.email_null=
\u
90AE
\u
7BB1
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.email_null=
\u
90AE
\u
7BB1
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.name_null
=
\u
59D3
\u
540D
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.name_null
=
\u
59D3
\u
540D
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.pwd_null
=
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
err.pwd_null
=
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
...
...
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