Browse Source

拦截验证方式更新

hejq 7 years ago
parent
commit
2c714de0be

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

@@ -141,6 +141,7 @@ public class SSOInterceptor extends AbstractSSOInterceptor {
 			} catch (IOException e) {
 				e.printStackTrace();
 			}
+            response.setStatus(HttpStatus.OK.value());
 			return true;
 		} else {
 			if (SecurityConstant.AUTHENTICATION_URL.equals(request.getRequestURI())) {

+ 5 - 8
src/main/webapp/resources/js/index/app.js

@@ -10,16 +10,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
     }]);
     app.factory('httpInterceptor', ['$window', '$q', function ($window, $q) {
-        var session = $window.sessionStorage;
         var httpInterceptor = {
             'responseError': function (response) {
-                if (!session.authenticated) {
-                    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();
-                        return $q.reject(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();
+                    return $q.reject(response);
                 }
                 return $q.reject(response);
             }