From 9c19da9ae679aaa30f70f4796ff34a0c4500b15b Mon Sep 17 00:00:00 2001 From: erzhongxmu Date: Mon, 23 May 2022 17:28:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/core/LoginController.java | 63 +++++++------------ src/main/resources/dbconfig.properties | 4 +- 2 files changed, 24 insertions(+), 43 deletions(-) diff --git a/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java b/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java index 5049673f..c0d7e5a6 100644 --- a/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java +++ b/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java @@ -49,7 +49,7 @@ import org.springframework.web.servlet.view.RedirectView; /** * 登陆初始化控制器 * @author admin - * + * */ //@Scope("prototype") @Controller @@ -61,7 +61,7 @@ public class LoginController extends BaseController{ @Autowired private MutiLangServiceI mutiLangService; - + @Autowired public void setSystemService(SystemService systemService) { this.systemService = systemService; @@ -81,7 +81,7 @@ public class LoginController extends BaseController{ /** * 检查用户名称 - * + * * @param user * @param req * @return @@ -140,11 +140,11 @@ public class LoginController extends BaseController{ } return j; } - - + + /** * 变更在线用户组织 - * + * * @param user * @param req * @return @@ -196,8 +196,8 @@ public class LoginController extends BaseController{ checkuser(user,req); } - - + + // 添加登陆日志 systemService.addLog(message, Globals.Log_Type_LOGIN, Globals.Log_Leavel_INFO); } @@ -205,7 +205,7 @@ public class LoginController extends BaseController{ /** * 用户登录 - * + * * @param request * @return */ @@ -222,13 +222,13 @@ public class LoginController extends BaseController{ if (roles.length() > 0) { roles = roles.substring(0, roles.length() - 1); } - + modelMap.put("roleName", roles.length()>3?roles.substring(0,3)+"...":roles); modelMap.put("userName", user.getUserName().length()>5?user.getUserName().substring(0, 5)+"...":user.getUserName()); modelMap.put("currentOrgName", ClientManager.getInstance().getClient().getUser().getCurrentDepart().getDepartname()); - + SysThemesEnum sysTheme = SysThemesUtil.getSysTheme(request); if("ace".equals(sysTheme.getStyle())||"diy".equals(sysTheme.getStyle())||"acele".equals(sysTheme.getStyle())||"hplus".equals(sysTheme.getStyle())){ request.setAttribute("menuMap", getFunctionMap(user)); @@ -252,7 +252,7 @@ public class LoginController extends BaseController{ /** * 退出系统 - * + * * @param request * @return */ @@ -275,7 +275,7 @@ public class LoginController extends BaseController{ /** * 菜单跳转 - * + * * @return */ @RequestMapping(params = "left") @@ -296,7 +296,7 @@ public class LoginController extends BaseController{ /** * 获取权限的map - * + * * @param user * @return */ @@ -338,7 +338,7 @@ public class LoginController extends BaseController{ /** * 获取用户菜单列表 - * + * * @param user * @return */ @@ -349,24 +349,7 @@ public class LoginController extends BaseController{ if (client.getFunctions() == null || client.getFunctions().size() == 0) { Map loginActionlist = new HashMap(); - - /*String hql="from TSFunction t where t.id in (select d.TSFunction.id from TSRoleFunction d where d.TSRole.id in(select t.TSRole.id from TSRoleUser t where t.TSUser.id ='"+ - user.getId()+"' ))"; - String hql2="from TSFunction t where t.id in ( select b.tsRole.id from TSRoleOrg b where b.tsDepart.id in(select a.tsDepart.id from TSUserOrg a where a.tsUser.id='"+ - user.getId()+"'))"; - List list = systemService.findHql(hql); - log.info("role functions: "+list.size()); - for(TSFunction function:list){ - loginActionlist.put(function.getId(),function); - } - List list2 = systemService.findHql(hql2); - log.info("org functions: "+list2.size()); - for(TSFunction function:list2){ - loginActionlist.put(function.getId(),function); - }*/ - StringBuilder hqlsb1=new StringBuilder("select distinct f from TSFunction f,TSRoleFunction rf,TSRoleUser ru ").append("where ru.TSRole.id=rf.TSRole.id and rf.TSFunction.id=f.id and ru.TSUser.id=? "); - StringBuilder hqlsb2=new StringBuilder("select distinct c from TSFunction c,TSRoleFunction rf,TSRoleOrg b,TSUserOrg a ") .append("where a.tsDepart.id=b.tsDepart.id and b.tsRole.id=rf.TSRole.id and rf.TSFunction.id=c.id and a.tsUser.id=?"); List list1 = systemService.findHql(hqlsb1.toString(),user.getId()); @@ -378,8 +361,6 @@ public class LoginController extends BaseController{ loginActionlist.put(function.getId(),function); } client.setFunctions(loginActionlist); - - //清空变量,降低内存使用 list2.clear(); list1.clear(); @@ -408,7 +389,7 @@ public class LoginController extends BaseController{ /** * 首页跳转 - * + * * @return */ @RequestMapping(params = "home") @@ -424,10 +405,10 @@ public class LoginController extends BaseController{ return new ModelAndView("main/home"); } - + /** * ACE首页跳转 - * + * * @return */ @RequestMapping(params = "acehome") @@ -463,7 +444,7 @@ public class LoginController extends BaseController{ } /** * 无权限页面提示跳转 - * + * * @return */ @RequestMapping(params = "noAuth") @@ -511,7 +492,7 @@ public class LoginController extends BaseController{ request.setAttribute("menuMap", getFunctionMap(user)); return new ModelAndView("main/shortcut_top"); } - + /** * @Title: top * @author:gaofeng @@ -580,7 +561,7 @@ public class LoginController extends BaseController{ floor += "
  • " + " " + "
  • "; }else if(lang_context.contains("消息推送")){ - + String s = "
    消息推送
    "; floor += "
  • "+s+" " + "
  • "; @@ -714,4 +695,4 @@ public class LoginController extends BaseController{ public String login3(){ return "login/login3"; } -} \ No newline at end of file +} diff --git a/src/main/resources/dbconfig.properties b/src/main/resources/dbconfig.properties index c5d66022..4b53fa9b 100644 --- a/src/main/resources/dbconfig.properties +++ b/src/main/resources/dbconfig.properties @@ -17,10 +17,10 @@ #MySQL hibernate.dialect=org.hibernate.dialect.MySQLDialect validationQuery.sqlserver=SELECT 1 -jdbc.url.jeecg=jdbc:mysql://127.0.0.1:3306/jee-wms?useUnicode=true&characterEncoding=UTF-8 +jdbc.url.jeecg=jdbc:mysql://127.0.0.1:3306/wms?useUnicode=true&characterEncoding=UTF-8 jdbc.username.jeecg=root -jdbc.password.jeecg=password +jdbc.password.jeecg=Zzerp123 jdbc.dbType=mysql #Oracle From 1280808c4917229a91cbe5808f1d6fd95ec2c5ec Mon Sep 17 00:00:00 2001 From: erzhongxmu Date: Mon, 23 May 2022 18:01:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/system/controller/core/LoginController.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java b/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java index c0d7e5a6..251000dd 100644 --- a/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java +++ b/src/main/java/org/jeecgframework/web/system/controller/core/LoginController.java @@ -431,15 +431,7 @@ public class LoginController extends BaseController{ */ @RequestMapping(params = "hplushome") public ModelAndView hplushome(HttpServletRequest request) { - SysThemesEnum sysTheme = SysThemesUtil.getSysTheme(request); - //ACE ACE2 DIY时需要在home.jsp头部引入依赖的js及css文件 - /*if("ace".equals(sysTheme.getStyle())||"diy".equals(sysTheme.getStyle())||"acele".equals(sysTheme.getStyle())){ - request.setAttribute("show", "1"); - } else {//default及shortcut不需要引入依赖文件,所有需要屏蔽 - request.setAttribute("show", "0"); - }*/ - return new ModelAndView("main/hplushome"); } /**