浏览代码

fix: opening links in the sidebar

Shishkevich D. 3 天之前
父节点
当前提交
127bea7f73
共有 1 个文件被更改,包括 8 次插入6 次删除
  1. 8 6
      web/html/xui/component/aSidebar.html

+ 8 - 6
web/html/xui/component/aSidebar.html

@@ -45,27 +45,27 @@
             return {
                 tabs: [
                     {
-                        key: '/panel/',
+                        key: 'panel/',
                         icon: 'dashboard',
                         title: '{{ i18n "menu.dashboard"}}'
                     },
                     {
-                        key: '/panel/inbounds',
+                        key: 'panel/inbounds',
                         icon: 'user',
                         title: '{{ i18n "menu.inbounds"}}'
                     },
                     {
-                        key: '/panel/settings',
+                        key: 'panel/settings',
                         icon: 'setting',
                         title: '{{ i18n "menu.settings"}}'
                     },
                     {
-                        key: '/panel/xray',
+                        key: 'panel/xray',
                         icon: 'tool',
                         title: '{{ i18n "menu.xray"}}'
                     },
                     {
-                        key: '/logout/',
+                        key: 'logout/',
                         icon: 'logout',
                         title: '{{ i18n "menu.logout"}}'
                     },
@@ -79,7 +79,9 @@
         },
         methods: {
             openLink(key) {
-                return key.startsWith('http') ? window.open(key) : location.href = key
+                return key.startsWith('http') ? 
+                    window.open(`{{ .base_path }}${key}`) : 
+                    location.href = `{{ .base_path }}${key}`
             },
             closeDrawer() {
                 this.visible = false;