Commit a8e71ad4 by PWF-WK01\pengwufeng

砂厂用户登录调整

parent cf71e17c
...@@ -6,6 +6,7 @@ import java.util.Date; ...@@ -6,6 +6,7 @@ import java.util.Date;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.JSONObject; import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -49,15 +50,16 @@ public class RESTWarehouseUserAuthenticationSuccessHandler extends SimpleUrlAuth ...@@ -49,15 +50,16 @@ public class RESTWarehouseUserAuthenticationSuccessHandler extends SimpleUrlAuth
if (warehouseUser != null) { if (warehouseUser != null) {
JSONObject returnJson = new JSONObject(); JSONObject returnJson = new JSONObject();
request.getSession().setAttribute(AuthcConstants.SESSION_TENANTID, tenant); HttpSession session = request.getSession();
session.setAttribute(AuthcConstants.SESSION_TENANTID, tenant);
request.getSession().setAttribute(AuthcConstants.USERID, warehouseUser.getId()); session.setAttribute(AuthcConstants.USERID, warehouseUser.getId());
request.getSession().setAttribute(AuthcConstants.USERNAME, warehouseUser.getUsername()); session.setAttribute(AuthcConstants.USERNAME, warehouseUser.getUsername());
request.getSession().setAttribute(AuthcConstants.TELEPHONE, warehouseUser.getTelephone()); session.setAttribute(AuthcConstants.TELEPHONE, warehouseUser.getTelephone());
request.getSession().setAttribute(AuthcConstants.TITLE, warehouseUser.getTitle()); session.setAttribute(AuthcConstants.TITLE, warehouseUser.getTitle());
request.getSession().setAttribute("mobile", true); session.setAttribute("mobile", true);
request.getSession().setMaxInactiveInterval(30 * 24 * 60 * 60); session.setMaxInactiveInterval(30 * 24 * 60 * 60);
//砂场用户可能没有租户
loginLog.setTenantId(tenant); loginLog.setTenantId(tenant);
loginLog.setDescription("warehouseUser login"); loginLog.setDescription("warehouseUser login");
loginLogService.insert(loginLog); loginLogService.insert(loginLog);
......
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