|
|
|
@@ -142,11 +142,6 @@ public class HomeController extends BaseController { |
|
|
|
MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); |
|
|
|
info.protectInfos(); |
|
|
|
|
|
|
|
String menus = mallUserRoleService.getPermissionsByUser(info); |
|
|
|
if(menus != null) { |
|
|
|
info.setMenus(menus); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
String cookieName = URLEncoder.encode(info.getUsername(), "utf-8"); |
|
|
|
Cookie unameCookie = new Cookie("uname", cookieName); |
|
|
|
@@ -154,20 +149,16 @@ public class HomeController extends BaseController { |
|
|
|
unameCookie.setMaxAge(3600); |
|
|
|
response.addCookie(unameCookie); |
|
|
|
|
|
|
|
data.data = info; |
|
|
|
|
|
|
|
MallUserAction action = new MallUserAction(); |
|
|
|
action.setTenantId(info.getTenantId()); |
|
|
|
action.setType(EnumMallUserAction.CONTROLLER.getCode()); |
|
|
|
action.setIp(ipaddress); |
|
|
|
action.setUserId(info.getId()); |
|
|
|
action.setActionDesc("用户登录"); |
|
|
|
action.setActionTime(new Date()); |
|
|
|
mallUserActionService.saveOrUpdate(action); |
|
|
|
Map map = new HashMap(); |
|
|
|
map.put("username", info.getUsername()); |
|
|
|
map.put("withWechat", info.getWithWechat()); |
|
|
|
data.data = map; |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
return new ResultData(Result.ERROR, e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
mallUserActionService.saveActionInfo(info.getTenantId(), EnumMallUserAction.CONTROLLER.getCode(), ipaddress, info.getId(), "用户登录"); |
|
|
|
} |
|
|
|
return data; |
|
|
|
} |
|
|
|
@@ -218,28 +209,22 @@ public class HomeController extends BaseController { |
|
|
|
Subject subject = SecurityUtils.getSubject(); |
|
|
|
UseriFormallToken token = new UseriFormallToken(user.getUsername()); |
|
|
|
subject.login(token); |
|
|
|
|
|
|
|
MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); |
|
|
|
info.protectInfos(); |
|
|
|
String menus = mallUserRoleService.getPermissionsByUser(info); |
|
|
|
if(menus != null) { |
|
|
|
info.setMenus(menus); |
|
|
|
} |
|
|
|
|
|
|
|
String cookieName = URLEncoder.encode(info.getUsername(), "utf-8"); |
|
|
|
Cookie unameCookie = new Cookie("uname", cookieName); |
|
|
|
unameCookie.setPath("/"); |
|
|
|
unameCookie.setMaxAge(3600); |
|
|
|
response.addCookie(unameCookie); |
|
|
|
|
|
|
|
MallUserAction action = new MallUserAction(); |
|
|
|
action.setTenantId(info.getTenantId()); |
|
|
|
action.setType(EnumMallUserAction.CONTROLLER.getCode()); |
|
|
|
action.setIp(ipaddress); |
|
|
|
action.setUserId(info.getId()); |
|
|
|
action.setActionDesc("用户登录"); |
|
|
|
action.setActionTime(new Date()); |
|
|
|
mallUserActionService.saveOrUpdate(action); |
|
|
|
Map map = new HashMap(); |
|
|
|
map.put("username", info.getUsername()); |
|
|
|
map.put("withWechat", info.getWithWechat()); |
|
|
|
data.data = map; |
|
|
|
|
|
|
|
data.data = info; |
|
|
|
mallUserActionService.saveActionInfo(info.getTenantId(), EnumMallUserAction.CONTROLLER.getCode(), ipaddress, info.getId(), "用户B端数据塔台登录"); |
|
|
|
} catch (MallinkException e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
return new ResultData(e.getErrorCode(), e.getMessage()); |
|
|
|
@@ -316,12 +301,9 @@ public class HomeController extends BaseController { |
|
|
|
Subject subject = SecurityUtils.getSubject(); |
|
|
|
UseriFormallToken token = new UseriFormallToken(user.getUsername()); |
|
|
|
subject.login(token); |
|
|
|
|
|
|
|
MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); |
|
|
|
info.protectInfos(); |
|
|
|
String menus = mallUserRoleService.getPermissionsByUser(info); |
|
|
|
if(menus != null) { |
|
|
|
info.setMenus(menus); |
|
|
|
} |
|
|
|
|
|
|
|
String cookieName = URLEncoder.encode(info.getUsername(), "utf-8"); |
|
|
|
Cookie unameCookie = new Cookie("uname", cookieName); |
|
|
|
@@ -329,14 +311,7 @@ public class HomeController extends BaseController { |
|
|
|
unameCookie.setMaxAge(3600); |
|
|
|
response.addCookie(unameCookie); |
|
|
|
|
|
|
|
MallUserAction action = new MallUserAction(); |
|
|
|
action.setTenantId(info.getTenantId()); |
|
|
|
action.setType(EnumMallUserAction.CONTROLLER.getCode()); |
|
|
|
action.setIp(ipaddress); |
|
|
|
action.setUserId(info.getId()); |
|
|
|
action.setActionDesc("用户手机号登录"); |
|
|
|
action.setActionTime(new Date()); |
|
|
|
mallUserActionService.saveOrUpdate(action); |
|
|
|
mallUserActionService.saveActionInfo(info.getTenantId(), EnumMallUserAction.CONTROLLER.getCode(), ipaddress, info.getId(), "用户手机号登录"); |
|
|
|
|
|
|
|
return new ResultData(info); |
|
|
|
} catch (MallinkException e) { |
|
|
|
|