瀏覽代碼

AMBARI-16987. After relogin get the same page was before logout instead of Dashboard (alexantonenko)

Alex Antonenko 9 年之前
父節點
當前提交
babe17dffd
共有 1 個文件被更改,包括 10 次插入4 次删除
  1. 10 4
      ambari-web/app/router.js

+ 10 - 4
ambari-web/app/router.js

@@ -597,7 +597,8 @@ App.Router = Em.Router.extend({
         name: 'router.logoff',
         sender: this,
         success: 'logOffSuccessCallback',
-        error: 'logOffErrorCallback'
+        error: 'logOffErrorCallback',
+        beforeSend: 'logOffBeforeSend'
       }).complete(function() {
         self.logoffRedirect(context);
       });
@@ -615,16 +616,21 @@ App.Router = Em.Router.extend({
 
   },
 
+  logOffBeforeSend: function(opt, xhr) {
+    xhr.setRequestHeader('Authorization', '');
+  },
+
   /**
    * Redirect function on sign off request.
    *
    * @param {$.Event} [context=undefined] - triggered event context
    */
   logoffRedirect: function(context) {
+    this.transitionTo('login', context);
     if (App.router.get('clusterController.isLoaded')) {
-      window.location.reload();
-    } else {
-      this.transitionTo('login', context);
+      Em.run.next(function() {
+        window.location.reload();
+      });
     }
   },