Преглед изворни кода

前端拦截方式处理更新

hejq пре 7 година
родитељ
комит
7c90ed2626
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      src/main/webapp/resources/js/index/app.js

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

@@ -11,11 +11,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
     }]);
     app.factory('httpInterceptor', ['$window', '$q', function ($window, $q) {
         var httpInterceptor = {
-            'responseError': function (response) {
+            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.reload();
+                    window.location.href = response.data.loginUrl || 'index';
                     return $q.reject(response);
                 }
                 return $q.reject(response);