Commit 5756708c authored by 曲欣亮's avatar 曲欣亮

登录返回令牌对象

parent f86eab4e
...@@ -29,8 +29,9 @@ public class LoginController { ...@@ -29,8 +29,9 @@ public class LoginController {
if(session.getAttribute(Constant.LOGIN_TOKEN_NAME) != null) { if(session.getAttribute(Constant.LOGIN_TOKEN_NAME) != null) {
throw new XException("用户已登录", 200); throw new XException("用户已登录", 200);
} else if(this.username.equals(username) && this.password.equals(password)) { } else if(this.username.equals(username) && this.password.equals(password)) {
session.setAttribute(Constant.LOGIN_TOKEN_NAME, new LoginToken(username)); LoginToken token = new LoginToken(username);
return Rjx.jsonOk(); session.setAttribute(Constant.LOGIN_TOKEN_NAME, token);
return Rjx.jsonOk().setData(token);
} else { } else {
if(StringUtil.isNotBlank(username, password)) { if(StringUtil.isNotBlank(username, password)) {
throw new XException("用户名或密码错误"); throw new XException("用户名或密码错误");
......
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