* Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: - + *
* The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - + *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -30,20 +30,25 @@
import io.swagger.annotations.ApiOperation;
import net.mingsoft.base.entity.ResultData;
import net.mingsoft.basic.action.BaseAction;
+import net.mingsoft.basic.bean.ShiroUser;
import net.mingsoft.basic.biz.IAppBiz;
import net.mingsoft.basic.biz.IManagerBiz;
import net.mingsoft.basic.biz.IRoleBiz;
import net.mingsoft.basic.constant.Const;
+import net.mingsoft.basic.constant.ErrorCodeEnum;
import net.mingsoft.basic.constant.e.SessionConstEnum;
import net.mingsoft.basic.entity.AppEntity;
import net.mingsoft.basic.entity.ManagerEntity;
import net.mingsoft.basic.entity.ManagerSessionEntity;
import net.mingsoft.basic.entity.RoleEntity;
+import net.mingsoft.basic.exception.DcmsLoginException;
import net.mingsoft.basic.util.BasicUtil;
+import net.mingsoft.basic.util.DcmsUtils;
import net.mingsoft.basic.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.session.ExpiredSessionException;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -56,14 +61,13 @@
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.List;
+import java.util.Map;
/**
- *
- * @ClassName: LoginAction
+ * @ClassName: LoginAction
* @Description:TODO(登录的基础应用层)
* @author: 铭飞开发团队
- * @date: 2015年1月27日 下午3:21:47
- *
+ * @date: 2015年1月27日 下午3:21:47
* @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
*/
@Api("登录的基础应用层接口")
@@ -71,146 +75,228 @@
@RequestMapping("/${ms.manager.path}")
public class LoginAction extends BaseAction {
- @Value("${ms.manager.path}")
- private String managerPath;
- /**
- * 管理员业务层
- */
- @Autowired
- private IManagerBiz managerBiz;
+ @Value("${ms.manager.path}")
+ private String managerPath;
+ @Value("${ms.manager.dcmsHost}")
+ private String dcmsHost;
+ @Value("${ms.manager.userInfoPath}")
+ private String userInfoPath;
+ @Value("#{${ms.manager.userRoles}}")
+ private Map
* Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: - + *
* The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - + *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -30,20 +30,25 @@
import io.swagger.annotations.ApiOperation;
import net.mingsoft.base.entity.ResultData;
import net.mingsoft.basic.action.BaseAction;
+import net.mingsoft.basic.bean.ShiroUser;
import net.mingsoft.basic.biz.IAppBiz;
import net.mingsoft.basic.biz.IManagerBiz;
import net.mingsoft.basic.biz.IRoleBiz;
import net.mingsoft.basic.constant.Const;
+import net.mingsoft.basic.constant.ErrorCodeEnum;
import net.mingsoft.basic.constant.e.SessionConstEnum;
import net.mingsoft.basic.entity.AppEntity;
import net.mingsoft.basic.entity.ManagerEntity;
import net.mingsoft.basic.entity.ManagerSessionEntity;
import net.mingsoft.basic.entity.RoleEntity;
+import net.mingsoft.basic.exception.DcmsLoginException;
import net.mingsoft.basic.util.BasicUtil;
+import net.mingsoft.basic.util.DcmsUtils;
import net.mingsoft.basic.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.session.ExpiredSessionException;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -56,14 +61,13 @@
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.List;
+import java.util.Map;
/**
- *
- * @ClassName: LoginAction
+ * @ClassName: LoginAction
* @Description:TODO(登录的基础应用层)
* @author: 铭飞开发团队
- * @date: 2015年1月27日 下午3:21:47
- *
+ * @date: 2015年1月27日 下午3:21:47
* @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
*/
@Api("登录的基础应用层接口")
@@ -71,146 +75,228 @@
@RequestMapping("/${ms.manager.path}")
public class LoginAction extends BaseAction {
- @Value("${ms.manager.path}")
- private String managerPath;
- /**
- * 管理员业务层
- */
- @Autowired
- private IManagerBiz managerBiz;
+ @Value("${ms.manager.path}")
+ private String managerPath;
+ @Value("${ms.manager.dcmsHost}")
+ private String dcmsHost;
+ @Value("${ms.manager.userInfoPath}")
+ private String userInfoPath;
+ @Value("#{${ms.manager.userRoles}}")
+ private Map
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
-
+ *
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
-
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -61,214 +61,263 @@
*/
@ControllerAdvice
public class GlobalExceptionResolver extends DefaultHandlerExceptionResolver {
-
- protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
- /**
- * 全局异常
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = Exception.class)
- public ModelAndView handleException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.SERVER_ERROR);
- return getModelAndView(request, response, map,e);
- }
+ protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
- /**
- * 全局异常 未找到类404
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = NoHandlerFoundException.class)
- public ModelAndView handleNoHandlerFoundException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 全局异常
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = Exception.class)
+ public ModelAndView handleException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.SERVER_ERROR);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 请求参数异常
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = MissingServletRequestParameterException.class)
- public ModelAndView handleMissingServletRequestParameterException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 全局异常 未找到类404
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = NoHandlerFoundException.class)
+ public ModelAndView handleNoHandlerFoundException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 请求方法类型错误
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class)
- public ModelAndView handleHttpRequestMethodNotSupportedException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 请求参数异常
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = MissingServletRequestParameterException.class)
+ public ModelAndView handleMissingServletRequestParameterException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 统一处理请求参数校验(实体对象传参)
- *
- * @param e BindException
- * @return ResultResponse
- */
- @ExceptionHandler(BindException.class)
- public ModelAndView validExceptionHandler(HttpServletRequest request, HttpServletResponse response,BindException e) {
- StringBuilder message = new StringBuilder();
- List
* Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: - + *
* The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - + *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -30,20 +30,25 @@
import io.swagger.annotations.ApiOperation;
import net.mingsoft.base.entity.ResultData;
import net.mingsoft.basic.action.BaseAction;
+import net.mingsoft.basic.bean.ShiroUser;
import net.mingsoft.basic.biz.IAppBiz;
import net.mingsoft.basic.biz.IManagerBiz;
import net.mingsoft.basic.biz.IRoleBiz;
import net.mingsoft.basic.constant.Const;
+import net.mingsoft.basic.constant.ErrorCodeEnum;
import net.mingsoft.basic.constant.e.SessionConstEnum;
import net.mingsoft.basic.entity.AppEntity;
import net.mingsoft.basic.entity.ManagerEntity;
import net.mingsoft.basic.entity.ManagerSessionEntity;
import net.mingsoft.basic.entity.RoleEntity;
+import net.mingsoft.basic.exception.DcmsLoginException;
import net.mingsoft.basic.util.BasicUtil;
+import net.mingsoft.basic.util.DcmsUtils;
import net.mingsoft.basic.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.session.ExpiredSessionException;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -56,14 +61,13 @@
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.List;
+import java.util.Map;
/**
- *
- * @ClassName: LoginAction
+ * @ClassName: LoginAction
* @Description:TODO(登录的基础应用层)
* @author: 铭飞开发团队
- * @date: 2015年1月27日 下午3:21:47
- *
+ * @date: 2015年1月27日 下午3:21:47
* @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
*/
@Api("登录的基础应用层接口")
@@ -71,146 +75,228 @@
@RequestMapping("/${ms.manager.path}")
public class LoginAction extends BaseAction {
- @Value("${ms.manager.path}")
- private String managerPath;
- /**
- * 管理员业务层
- */
- @Autowired
- private IManagerBiz managerBiz;
+ @Value("${ms.manager.path}")
+ private String managerPath;
+ @Value("${ms.manager.dcmsHost}")
+ private String dcmsHost;
+ @Value("${ms.manager.userInfoPath}")
+ private String userInfoPath;
+ @Value("#{${ms.manager.userRoles}}")
+ private Map
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
-
+ *
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
-
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -61,214 +61,263 @@
*/
@ControllerAdvice
public class GlobalExceptionResolver extends DefaultHandlerExceptionResolver {
-
- protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
- /**
- * 全局异常
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = Exception.class)
- public ModelAndView handleException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.SERVER_ERROR);
- return getModelAndView(request, response, map,e);
- }
+ protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
- /**
- * 全局异常 未找到类404
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = NoHandlerFoundException.class)
- public ModelAndView handleNoHandlerFoundException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 全局异常
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = Exception.class)
+ public ModelAndView handleException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.SERVER_ERROR);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 请求参数异常
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = MissingServletRequestParameterException.class)
- public ModelAndView handleMissingServletRequestParameterException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 全局异常 未找到类404
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = NoHandlerFoundException.class)
+ public ModelAndView handleNoHandlerFoundException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 请求方法类型错误
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class)
- public ModelAndView handleHttpRequestMethodNotSupportedException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 请求参数异常
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = MissingServletRequestParameterException.class)
+ public ModelAndView handleMissingServletRequestParameterException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 统一处理请求参数校验(实体对象传参)
- *
- * @param e BindException
- * @return ResultResponse
- */
- @ExceptionHandler(BindException.class)
- public ModelAndView validExceptionHandler(HttpServletRequest request, HttpServletResponse response,BindException e) {
- StringBuilder message = new StringBuilder();
- List
* Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: - + *
* The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - + *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -30,20 +30,25 @@
import io.swagger.annotations.ApiOperation;
import net.mingsoft.base.entity.ResultData;
import net.mingsoft.basic.action.BaseAction;
+import net.mingsoft.basic.bean.ShiroUser;
import net.mingsoft.basic.biz.IAppBiz;
import net.mingsoft.basic.biz.IManagerBiz;
import net.mingsoft.basic.biz.IRoleBiz;
import net.mingsoft.basic.constant.Const;
+import net.mingsoft.basic.constant.ErrorCodeEnum;
import net.mingsoft.basic.constant.e.SessionConstEnum;
import net.mingsoft.basic.entity.AppEntity;
import net.mingsoft.basic.entity.ManagerEntity;
import net.mingsoft.basic.entity.ManagerSessionEntity;
import net.mingsoft.basic.entity.RoleEntity;
+import net.mingsoft.basic.exception.DcmsLoginException;
import net.mingsoft.basic.util.BasicUtil;
+import net.mingsoft.basic.util.DcmsUtils;
import net.mingsoft.basic.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.session.ExpiredSessionException;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -56,14 +61,13 @@
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.List;
+import java.util.Map;
/**
- *
- * @ClassName: LoginAction
+ * @ClassName: LoginAction
* @Description:TODO(登录的基础应用层)
* @author: 铭飞开发团队
- * @date: 2015年1月27日 下午3:21:47
- *
+ * @date: 2015年1月27日 下午3:21:47
* @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
*/
@Api("登录的基础应用层接口")
@@ -71,146 +75,228 @@
@RequestMapping("/${ms.manager.path}")
public class LoginAction extends BaseAction {
- @Value("${ms.manager.path}")
- private String managerPath;
- /**
- * 管理员业务层
- */
- @Autowired
- private IManagerBiz managerBiz;
+ @Value("${ms.manager.path}")
+ private String managerPath;
+ @Value("${ms.manager.dcmsHost}")
+ private String dcmsHost;
+ @Value("${ms.manager.userInfoPath}")
+ private String userInfoPath;
+ @Value("#{${ms.manager.userRoles}}")
+ private Map
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
-
+ *
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
-
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -61,214 +61,263 @@
*/
@ControllerAdvice
public class GlobalExceptionResolver extends DefaultHandlerExceptionResolver {
-
- protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
- /**
- * 全局异常
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = Exception.class)
- public ModelAndView handleException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.SERVER_ERROR);
- return getModelAndView(request, response, map,e);
- }
+ protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
- /**
- * 全局异常 未找到类404
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = NoHandlerFoundException.class)
- public ModelAndView handleNoHandlerFoundException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 全局异常
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = Exception.class)
+ public ModelAndView handleException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.SERVER_ERROR);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 请求参数异常
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = MissingServletRequestParameterException.class)
- public ModelAndView handleMissingServletRequestParameterException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 全局异常 未找到类404
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = NoHandlerFoundException.class)
+ public ModelAndView handleNoHandlerFoundException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 请求方法类型错误
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class)
- public ModelAndView handleHttpRequestMethodNotSupportedException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 请求参数异常
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = MissingServletRequestParameterException.class)
+ public ModelAndView handleMissingServletRequestParameterException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 统一处理请求参数校验(实体对象传参)
- *
- * @param e BindException
- * @return ResultResponse
- */
- @ExceptionHandler(BindException.class)
- public ModelAndView validExceptionHandler(HttpServletRequest request, HttpServletResponse response,BindException e) {
- StringBuilder message = new StringBuilder();
- List
* Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: - + *
* The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - + *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -30,20 +30,25 @@
import io.swagger.annotations.ApiOperation;
import net.mingsoft.base.entity.ResultData;
import net.mingsoft.basic.action.BaseAction;
+import net.mingsoft.basic.bean.ShiroUser;
import net.mingsoft.basic.biz.IAppBiz;
import net.mingsoft.basic.biz.IManagerBiz;
import net.mingsoft.basic.biz.IRoleBiz;
import net.mingsoft.basic.constant.Const;
+import net.mingsoft.basic.constant.ErrorCodeEnum;
import net.mingsoft.basic.constant.e.SessionConstEnum;
import net.mingsoft.basic.entity.AppEntity;
import net.mingsoft.basic.entity.ManagerEntity;
import net.mingsoft.basic.entity.ManagerSessionEntity;
import net.mingsoft.basic.entity.RoleEntity;
+import net.mingsoft.basic.exception.DcmsLoginException;
import net.mingsoft.basic.util.BasicUtil;
+import net.mingsoft.basic.util.DcmsUtils;
import net.mingsoft.basic.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.session.ExpiredSessionException;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -56,14 +61,13 @@
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.List;
+import java.util.Map;
/**
- *
- * @ClassName: LoginAction
+ * @ClassName: LoginAction
* @Description:TODO(登录的基础应用层)
* @author: 铭飞开发团队
- * @date: 2015年1月27日 下午3:21:47
- *
+ * @date: 2015年1月27日 下午3:21:47
* @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
*/
@Api("登录的基础应用层接口")
@@ -71,146 +75,228 @@
@RequestMapping("/${ms.manager.path}")
public class LoginAction extends BaseAction {
- @Value("${ms.manager.path}")
- private String managerPath;
- /**
- * 管理员业务层
- */
- @Autowired
- private IManagerBiz managerBiz;
+ @Value("${ms.manager.path}")
+ private String managerPath;
+ @Value("${ms.manager.dcmsHost}")
+ private String dcmsHost;
+ @Value("${ms.manager.userInfoPath}")
+ private String userInfoPath;
+ @Value("#{${ms.manager.userRoles}}")
+ private Map
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
-
+ *
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
-
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
@@ -61,214 +61,263 @@
*/
@ControllerAdvice
public class GlobalExceptionResolver extends DefaultHandlerExceptionResolver {
-
- protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
- /**
- * 全局异常
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = Exception.class)
- public ModelAndView handleException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.SERVER_ERROR);
- return getModelAndView(request, response, map,e);
- }
+ protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
- /**
- * 全局异常 未找到类404
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = NoHandlerFoundException.class)
- public ModelAndView handleNoHandlerFoundException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 全局异常
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = Exception.class)
+ public ModelAndView handleException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.SERVER_ERROR);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 请求参数异常
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = MissingServletRequestParameterException.class)
- public ModelAndView handleMissingServletRequestParameterException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 全局异常 未找到类404
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = NoHandlerFoundException.class)
+ public ModelAndView handleNoHandlerFoundException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 请求方法类型错误
- * @param request
- * @param response
- * @param e
- * @return
- */
- @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class)
- public ModelAndView handleHttpRequestMethodNotSupportedException(HttpServletRequest request, HttpServletResponse response,Exception e) {
- Map map = new HashMap();
- map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
- return getModelAndView(request, response, map,e);
- }
+ /**
+ * 请求参数异常
+ * @param request
+ * @param response
+ * @param e
+ * @return
+ */
+ @ExceptionHandler(value = MissingServletRequestParameterException.class)
+ public ModelAndView handleMissingServletRequestParameterException(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ Map map = new HashMap();
+ map.put("code", ErrorCodeEnum.CLIENT_NOT_FIND);
+ return getModelAndView(request, response, map, e);
+ }
- /**
- * 统一处理请求参数校验(实体对象传参)
- *
- * @param e BindException
- * @return ResultResponse
- */
- @ExceptionHandler(BindException.class)
- public ModelAndView validExceptionHandler(HttpServletRequest request, HttpServletResponse response,BindException e) {
- StringBuilder message = new StringBuilder();
- List