瀏覽代碼

HUE-8750 [useradmin] Fix 404 after creating a user.

Jean-Francois Desjeans Gauthier 6 年之前
父節點
當前提交
48a82fb4a2
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      desktop/core/src/desktop/js/onePageViewModel.js

+ 8 - 2
desktop/core/src/desktop/js/onePageViewModel.js

@@ -837,8 +837,14 @@ class OnePageViewModel {
     huePubSub.subscribe('open.link', href => {
       if (href) {
         const prefix = window.IS_EMBEDDED ? '' : '/hue';
-        if (href.startsWith('/') && !href.startsWith(prefix)) {
-          page(window.HUE_BASE_URL + prefix + href);
+        if (href.startsWith('/')) {
+          if (window.HUE_BASE_URL.length && href.startsWith(window.HUE_BASE_URL)) {
+            page(href);
+          } else if (href.startsWith(prefix)) {
+            page(window.HUE_BASE_URL + href);
+          } else {
+            page(window.HUE_BASE_URL + prefix + href);
+          }
         } else if (href.indexOf('#') == 0) {
           // Only place that seem to use this is hbase onclick row
           window.location.hash = href;