Commit e9aa114f authored by Quxl's avatar Quxl

xx

parent 98d89338
......@@ -18,5 +18,5 @@ public interface TokenService {
boolean isLoginByToken(String token);
void log(HttpServletRequest request);
void doLog(HttpServletRequest request);
}
......@@ -34,7 +34,7 @@ public class AdminLoginController {
} else {
LoginToken token = tokenService.doLogin(username, password);
if(token != null) {
tokenService.log(request);
tokenService.doLog(request);
return Rjx.jsonOk().setData(token);
} else {
throw new XException("用户名或密码错误");
......
......@@ -101,7 +101,7 @@ public class AdminTokenServiceImpl implements AdminTokenService {
}
@Override
public void log(HttpServletRequest request) {
public void doLog(HttpServletRequest request) {
LoginToken token = this.getToken();
String loginid = String.valueOf(token.getId());
Date now = new Date();
......
......@@ -43,7 +43,7 @@ public class MemberLoginController {
} else {
LoginToken token = tokenService.doLogin(username, password);
if(token != null) {
tokenService.log(request);
tokenService.doLog(request);
return Rjx.jsonOk();
} else {
throw new XException(messages.get("err.user_or_pwd"));
......
......@@ -105,7 +105,7 @@ public class MemberTokenServiceImpl implements MemberTokenService {
}
@Override
public void log(HttpServletRequest request) {
public void doLog(HttpServletRequest request) {
LoginToken token = this.getToken();
String loginid = String.valueOf(token.getId());
Date now = new Date();
......
......@@ -96,7 +96,7 @@ public class UserTokenServiceImpl implements UserTokenService {
}
@Override
public void log(HttpServletRequest request) {
public void doLog(HttpServletRequest request) {
LoginToken token = this.getToken();
String loginid = String.valueOf(token.getId());
Date now = new Date();
......
......@@ -21,7 +21,7 @@ public class AdminLoginInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse resp, Object handler) throws Exception {
if(tokenService.isLogin()) {
tokenService.log(req);
tokenService.doLog(req);
return super.preHandle(req, resp, handler);
} else {
String sessionid = null;
......@@ -32,7 +32,7 @@ public class AdminLoginInterceptor extends HandlerInterceptorAdapter {
}
}
if(sessionid != null && tokenService.isLoginByToken(sessionid)) {
tokenService.log(req);
tokenService.doLog(req);
return super.preHandle(req, resp, handler);
}
throw new XException("用户未登陆", 300);
......
......@@ -21,7 +21,7 @@ public class MemberLoginInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse resp, Object handler) throws Exception {
if(tokenService.isLogin()) {
tokenService.log(req);
tokenService.doLog(req);
return super.preHandle(req, resp, handler);
} else {
String sessionid = null;
......@@ -32,7 +32,7 @@ public class MemberLoginInterceptor extends HandlerInterceptorAdapter {
}
}
if(sessionid != null && tokenService.isLoginByToken(sessionid)) {
tokenService.log(req);
tokenService.doLog(req);
return super.preHandle(req, resp, handler);
}
throw new XException("用户未登陆", 300);
......
......@@ -21,7 +21,7 @@ public class UserLoginInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse resp, Object handler) throws Exception {
if(tokenService.isLogin()) {
tokenService.log(req);
tokenService.doLog(req);
return super.preHandle(req, resp, handler);
} else {
String sessionid = null;
......@@ -32,7 +32,7 @@ public class UserLoginInterceptor extends HandlerInterceptorAdapter {
}
}
if(sessionid != null && tokenService.isLoginByToken(sessionid)) {
tokenService.log(req);
tokenService.doLog(req);
return super.preHandle(req, resp, handler);
}
throw new XException("用户未登陆", 300);
......
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