Commit 19d61645 authored by Quxl's avatar Quxl

优化注册校验

parent 5625c73b
...@@ -51,6 +51,9 @@ public class MemberOpenApiController { ...@@ -51,6 +51,9 @@ public class MemberOpenApiController {
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "email"), @ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "email"),
}) })
public Object register(HttpServletRequest request, String username, String password, String 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(); Locale locale = LocaleContextHolder.getLocale();
String salt = Common.getGenerateString(6); String salt = Common.getGenerateString(6);
String encodePwd = Common.encodePassword(password, salt); String encodePwd = Common.encodePassword(password, salt);
...@@ -75,6 +78,7 @@ public class MemberOpenApiController { ...@@ -75,6 +78,7 @@ public class MemberOpenApiController {
@ApiOperation("找回密码") @ApiOperation("找回密码")
@ApiImplicitParams({@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "email")}) @ApiImplicitParams({@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "email")})
public Object resetPassword(String email) { public Object resetPassword(String email) {
XException.assertNotBlank(messages.get("sys.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 = memberService.getMemberByEmail(email);
......
msg.test=Test
email.getPassword.subject=China Film Festival [retrieve password] email email.getPassword.subject=China Film Festival [retrieve password] email
email.getPassword.content=Hello {0}, Your password is: [{1}] email.getPassword.content=Hello {0}, Your password is: [{1}]
...@@ -6,5 +7,7 @@ sys.err.user_disabled=User disabled ...@@ -6,5 +7,7 @@ sys.err.user_disabled=User disabled
sys.err.user_pwd_err=User or password error sys.err.user_pwd_err=User or password error
sys.err.user_pwd_null=User and passowrd can not be null sys.err.user_pwd_null=User and passowrd can not be null
sys.err.user_exists=User already exists 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
msg.test=\u6D4B\u8BD5
email.getPassword.subject=\u4E2D\u56FD\u7535\u5F71\u8282[\u627E\u56DE\u5BC6\u7801]\u90AE\u4EF6 email.getPassword.subject=\u4E2D\u56FD\u7535\u5F71\u8282[\u627E\u56DE\u5BC6\u7801]\u90AE\u4EF6
email.getPassword.content={0} \u60A8\u597D, \u60A8\u7684\u65B0\u5BC6\u7801\u662F: [{1}] email.getPassword.content={0} \u60A8\u597D, \u60A8\u7684\u65B0\u5BC6\u7801\u662F: [{1}]
...@@ -6,5 +7,7 @@ sys.err.user_disabled=\u7528\u6237\u5DF2\u7ECF\u7981\u7528 ...@@ -6,5 +7,7 @@ sys.err.user_disabled=\u7528\u6237\u5DF2\u7ECF\u7981\u7528
sys.err.user_pwd_err=\u7528\u6237\u6216\u5BC6\u7801\u9519\u8BEF sys.err.user_pwd_err=\u7528\u6237\u6216\u5BC6\u7801\u9519\u8BEF
sys.err.user_pwd_null=\u7528\u6237\u540D\u548C\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A sys.err.user_pwd_null=\u7528\u6237\u540D\u548C\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A
sys.err.user_exists=\u7528\u6237\u5DF2\u5B58\u5728 sys.err.user_exists=\u7528\u6237\u5DF2\u5B58\u5728
sys.err.email_null=\u90AE\u7BB1\u4E0D\u80FD\u4E3A\u7A7A
sys.err.name_null=\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A
sys.err.pwd_null=\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A
msg.test=\u6D4B\u8BD5
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment