Ver código fonte

还原拦截验证方式

hejq 7 anos atrás
pai
commit
15bee8dbf1

+ 1 - 4
src/main/java/com/uas/platform/b2b/filter/SSOInterceptor.java

@@ -189,10 +189,7 @@ public class SSOInterceptor extends AbstractSSOInterceptor {
      * @param authorized 验证是否通过
      */
     protected void setResponseAuthorized(HttpServletResponse response, User user, boolean authorized) {
-        if (!authorized) {
-            // 再次校验是否还存在用户信息
-            user = SystemSession.getUser();
-        }
+        response.setStatus(authorized ? HttpStatus.OK.value() : HttpStatus.UNAUTHORIZED.value());
         if (null != user && null != user.getEnterprise()) {
             response.setStatus(authorized ? HttpStatus.OK.value() : HttpStatus.UNAUTHORIZED.value());
             String authorizedValue = authorized ? HttpStatus.OK.name() : HttpStatus.UNAUTHORIZED.name();

+ 2 - 2
src/main/webapp/resources/js/index/app.js

@@ -14,8 +14,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             'responseError': function (response) {
                 if (response.status == 401) {// UNAUTHORIZED
                     // window.location.href = response.data.loginUrl || 'index';
-                    window.location.href = window.location.origin + window.location.pathname + '/login';
-                    // window.location.reload();
+                    // window.location.href = window.location.origin + window.location.pathname + '/login';
+                    window.location.reload();
                     return $q.reject(response);
                 }
                 return $q.reject(response);