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
19d61645
Commit
19d61645
authored
Oct 11, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化注册校验
parent
5625c73b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
MemberOpenApiController.java
...main/java/com/egolm/film/api/MemberOpenApiController.java
+4
-0
messages_en_US.properties
src/main/resources/i18n/messages_en_US.properties
+4
-1
messages_zh_CN.properties
src/main/resources/i18n/messages_zh_CN.properties
+4
-1
No files found.
src/main/java/com/egolm/film/api/MemberOpenApiController.java
View file @
19d61645
...
...
@@ -51,6 +51,9 @@ public class MemberOpenApiController {
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
true
,
name
=
"email"
),
})
public
Object
register
(
HttpServletRequest
request
,
String
username
,
String
password
,
String
email
)
{
XException
.
assertNotBlank
(
messages
.
get
(
"sys.err.email_null"
),
email
);
XException
.
assertNotBlank
(
messages
.
get
(
"sys.err.name_null"
),
username
);
XException
.
assertNotBlank
(
messages
.
get
(
"sys.err.pwd_null"
),
password
);
Locale
locale
=
LocaleContextHolder
.
getLocale
();
String
salt
=
Common
.
getGenerateString
(
6
);
String
encodePwd
=
Common
.
encodePassword
(
password
,
salt
);
...
...
@@ -75,6 +78,7 @@ public class MemberOpenApiController {
@ApiOperation
(
"找回密码"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
true
,
name
=
"email"
)})
public
Object
resetPassword
(
String
email
)
{
XException
.
assertNotBlank
(
messages
.
get
(
"sys.err.email_null"
),
email
);
int
code
=
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
10000000
);
String
password
=
String
.
valueOf
(
code
);
Fc_member
member
=
memberService
.
getMemberByEmail
(
email
);
...
...
src/main/resources/i18n/messages_en_US.properties
View file @
19d61645
msg.test
=
Test
email.getPassword.subject
=
China Film Festival [retrieve password] email
email.getPassword.content
=
Hello {0}, Your password is: [{1}]
...
...
@@ -6,5 +7,7 @@ sys.err.user_disabled=User disabled
sys.err.user_pwd_err
=
User or password error
sys.err.user_pwd_null
=
User and passowrd can not be null
sys.err.user_exists
=
User already exists
sys.err.email_null
=
The mailbox can not be empty
sys.err.name_null
=
The username can not be empty
sys.err.pwd_null
=
The password can not be empty
msg.test
=
Test
\ No newline at end of file
src/main/resources/i18n/messages_zh_CN.properties
View file @
19d61645
msg.test
=
\u
6D4B
\u
8BD5
email.getPassword.subject
=
\u
4E2D
\u
56FD
\u7535\u
5F71
\u8282
[
\u
627E
\u
56DE
\u
5BC6
\u7801
]
\u
90AE
\u
4EF6
email.getPassword.content
=
{0}
\u
60A8
\u
597D,
\u
60A8
\u7684\u
65B0
\u
5BC6
\u7801\u
662F: [{1}]
...
...
@@ -6,5 +7,7 @@ sys.err.user_disabled=\u7528\u6237\u5DF2\u7ECF\u7981\u7528
sys.err.user_pwd_err=
\u7528\u6237\u6216\u
5BC6
\u7801\u9519\u
8BEF
sys.err.user_pwd_null
=
\u7528\u6237\u
540D
\u
548C
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
sys.err.user_exists
=
\u7528\u6237\u
5DF2
\u
5B58
\u5728
sys.err.email_null=
\u
90AE
\u
7BB1
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
sys.err.name_null
=
\u
59D3
\u
540D
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
sys.err.pwd_null
=
\u
5BC6
\u7801\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
msg.test=
\u
6D4B
\u
8BD5
\ No newline at end of file
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