Commit 1aac2c7d authored by Quxl's avatar Quxl

x

parent c093be65
......@@ -2,10 +2,15 @@ package com.egolm.film.api.service;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.egolm.film.model.LoginToken;
public interface TokenService {
Logger logger = LoggerFactory.getLogger(TokenService.class);
LoginToken getToken();
Object getTokenObj();
......
......@@ -48,6 +48,7 @@ public class AdminTokenServiceImpl implements AdminTokenService {
String sql = "update fc_admin set token = ?, login_ip = ?, login_time = ? where adminid = ?";
String loginIp = ServletUtil.remoteIp(WebMvcConfig.getRequest());
jdbcTemplate.executeUpdate(sql, cookie.getValue(), loginIp, System.currentTimeMillis()/1000, adminid);
logger.debug("admin login success: " + username);
}
return token;
} else if(state == 2) {
......
......@@ -56,6 +56,7 @@ public class MemberTokenServiceImpl implements MemberTokenService {
String loginIp = ServletUtil.remoteIp(WebMvcConfig.getRequest());
memberService.updateLoginInfo(id, loginIp, cookie.getValue());
}
logger.debug("member login success: " + email);
return token;
} else {
throw new XException(messages.get("err.user_pwd_err"));
......
......@@ -53,6 +53,7 @@ public class UserTokenServiceImpl implements UserTokenService {
String loginIp = ServletUtil.remoteIp(WebMvcConfig.getRequest());
jdbcTemplate.executeUpdate(sql, cookie.getValue(), loginIp, System.currentTimeMillis()/1000, uid);
}
logger.debug("user login success: " + username);
return token;
} else {
throw new XException(messages.get("err.user_pwd_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