|
|
@@ -176,18 +176,32 @@ public class SSOInterceptor extends AbstractSSOInterceptor {
|
|
|
* admin权限验证
|
|
|
*/
|
|
|
private void accessAdmin(HttpServletRequest request,User user) {
|
|
|
- if (!user.getEnterprise().getUu().toString().equals(enUU) && request.getServletPath().equals("/admin")) {
|
|
|
- //throw new AccessDeniedException("无法访问,您没有权限!");
|
|
|
- HttpServletResponse response = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getResponse();
|
|
|
- try {
|
|
|
- response.setHeader("Content-type", "text/html;charset=UTF-8");
|
|
|
- response.getWriter().write("您没有管理权限,请联系优软商城");
|
|
|
- } catch (IOException e) {
|
|
|
+ if (!StringUtils.isEmpty(user.getEnterprise())) {
|
|
|
+ if (!user.getEnterprise().getUu().toString().equals(enUU) && request.getServletPath().equals("/admin")) {
|
|
|
+ //throw new AccessDeniedException("无法访问,您没有权限!");
|
|
|
+ HttpServletResponse response = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getResponse();
|
|
|
+ try {
|
|
|
+ response.setHeader("Content-type", "text/html;charset=UTF-8");
|
|
|
+ response.getWriter().write("您没有管理权限,请联系优软商城");
|
|
|
+ } catch (IOException e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ throw new AccessDeniedException("无法访问,您没有权限!");
|
|
|
|
|
|
}
|
|
|
- throw new AccessDeniedException("无法访问,您没有权限!");
|
|
|
+ } else {
|
|
|
+ if (request.getServletPath().equals("/admin")) {
|
|
|
+ HttpServletResponse response = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getResponse();
|
|
|
+ try {
|
|
|
+ response.setHeader("Content-type", "text/html;charset=UTF-8");
|
|
|
+ response.getWriter().write("您没有管理权限,请联系优软商城");
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
|
+ }
|
|
|
+ throw new AccessDeniedException("无法访问,您没有权限!");
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|