Commit 677cfef7 authored by Quxl's avatar Quxl

修改消息提示

parent a8b5fe46
...@@ -31,7 +31,7 @@ public class AdminLoginController { ...@@ -31,7 +31,7 @@ public class AdminLoginController {
@PostMapping("login") @PostMapping("login")
@ApiOperation("登陆") @ApiOperation("登陆")
public Object login(String username, String password) { public Object login(String username, String password) {
XException.assertNotBlank(messages.get("sys.err.user_pwd_null"), username, password); XException.assertNotBlank(messages.get("err.user_pwd_null"), username, password);
if(tokenService.isLogin()) { if(tokenService.isLogin()) {
throw new XException("用户已登录", 200); throw new XException("用户已登录", 200);
} else { } else {
...@@ -39,7 +39,7 @@ public class AdminLoginController { ...@@ -39,7 +39,7 @@ public class AdminLoginController {
if(token != null) { if(token != null) {
return Rjx.jsonOk().setData(token); return Rjx.jsonOk().setData(token);
} else { } else {
throw new XException(messages.get("sys.err.user_or_pwd")); throw new XException(messages.get("err.user_or_pwd"));
} }
} }
} }
......
...@@ -30,7 +30,7 @@ public class MemberLoginController { ...@@ -30,7 +30,7 @@ public class MemberLoginController {
@PostMapping("login") @PostMapping("login")
@ApiOperation("登陆") @ApiOperation("登陆")
public Object login(String username, String password) { public Object login(String username, String password) {
XException.assertNotBlank(messages.get("sys.err.user_pwd_null"), username, password); XException.assertNotBlank(messages.get("err.user_pwd_null"), username, password);
if(tokenService.isLogin()) { if(tokenService.isLogin()) {
throw new XException("", 200); throw new XException("", 200);
} else { } else {
...@@ -38,7 +38,7 @@ public class MemberLoginController { ...@@ -38,7 +38,7 @@ public class MemberLoginController {
if(token != null) { if(token != null) {
return Rjx.jsonOk(); return Rjx.jsonOk();
} else { } else {
throw new XException(messages.get("sys.err.user_or_pwd")); throw new XException(messages.get("err.user_or_pwd"));
} }
} }
} }
......
...@@ -30,7 +30,7 @@ public class UserLoginController { ...@@ -30,7 +30,7 @@ public class UserLoginController {
@PostMapping("login") @PostMapping("login")
@ApiOperation("登陆") @ApiOperation("登陆")
public Object login(String username, String password) { public Object login(String username, String password) {
XException.assertNotBlank(messages.get("sys.err.user_pwd_null"), username, password); XException.assertNotBlank(messages.get("err.user_pwd_null"), username, password);
if(tokenService.isLogin()) { if(tokenService.isLogin()) {
throw new XException("", 200); throw new XException("", 200);
} else { } else {
...@@ -38,7 +38,7 @@ public class UserLoginController { ...@@ -38,7 +38,7 @@ public class UserLoginController {
if(token != null) { if(token != null) {
return Rjx.jsonOk().setData(token); return Rjx.jsonOk().setData(token);
} else { } else {
throw new XException(messages.get("sys.err.user_or_pwd")); throw new XException(messages.get("err.user_or_pwd"));
} }
} }
} }
......
...@@ -30,7 +30,7 @@ public class MemberTokenServiceImpl implements MemberTokenService { ...@@ -30,7 +30,7 @@ public class MemberTokenServiceImpl implements MemberTokenService {
try { try {
member = memberService.getMemberByEmail(email); member = memberService.getMemberByEmail(email);
} catch (Exception e) { } catch (Exception e) {
throw new XException(messages.get("sys.err.user_pwd_err")); throw new XException(messages.get("err.user_pwd_err"));
} }
Integer state = member.getState(); Integer state = member.getState();
if(state == 1) { if(state == 1) {
...@@ -43,12 +43,12 @@ public class MemberTokenServiceImpl implements MemberTokenService { ...@@ -43,12 +43,12 @@ public class MemberTokenServiceImpl implements MemberTokenService {
session.setAttribute(TOKEN_NAME, token); session.setAttribute(TOKEN_NAME, token);
return token; return token;
} else { } else {
throw new XException(messages.get("sys.err.user_pwd_err")); throw new XException(messages.get("err.user_pwd_err"));
} }
} else if(state == 2) { } else if(state == 2) {
throw new XException(messages.get("sys.err.user_disabled")); throw new XException(messages.get("err.user_disabled"));
} else { } else {
throw new XException(messages.get("sys.err")); throw new XException(messages.get("err"));
} }
} }
......
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