正在显示
1 个修改的文件
包含
6 行增加
和
1 行删除
| @@ -73,8 +73,10 @@ export default { | @@ -73,8 +73,10 @@ export default { | ||
| 73 | if(router.path === "/") { | 73 | if(router.path === "/") { |
| 74 | router.children[item].path = "/redirect/" + router.children[item].path; | 74 | router.children[item].path = "/redirect/" + router.children[item].path; |
| 75 | } else { | 75 | } else { |
| 76 | + if(!this.ishttp(router.children[item].path)) { | ||
| 76 | router.children[item].path = router.path + "/" + router.children[item].path; | 77 | router.children[item].path = router.path + "/" + router.children[item].path; |
| 77 | } | 78 | } |
| 79 | + } | ||
| 78 | router.children[item].parentPath = router.path; | 80 | router.children[item].parentPath = router.path; |
| 79 | } | 81 | } |
| 80 | childrenMenus.push(router.children[item]); | 82 | childrenMenus.push(router.children[item]); |
| @@ -122,7 +124,7 @@ export default { | @@ -122,7 +124,7 @@ export default { | ||
| 122 | // 菜单选择事件 | 124 | // 菜单选择事件 |
| 123 | handleSelect(key, keyPath) { | 125 | handleSelect(key, keyPath) { |
| 124 | this.currentIndex = key; | 126 | this.currentIndex = key; |
| 125 | - if (key.indexOf("http://") !== -1 || key.indexOf("https://") !== -1) { | 127 | + if (this.ishttp(key)) { |
| 126 | // http(s):// 路径新窗口打开 | 128 | // http(s):// 路径新窗口打开 |
| 127 | window.open(key, "_blank"); | 129 | window.open(key, "_blank"); |
| 128 | } else if (key.indexOf("/redirect") !== -1) { | 130 | } else if (key.indexOf("/redirect") !== -1) { |
| @@ -147,6 +149,9 @@ export default { | @@ -147,6 +149,9 @@ export default { | ||
| 147 | this.$store.commit("SET_SIDEBAR_ROUTERS", routes); | 149 | this.$store.commit("SET_SIDEBAR_ROUTERS", routes); |
| 148 | } | 150 | } |
| 149 | return routes; | 151 | return routes; |
| 152 | + }, | ||
| 153 | + ishttp(url) { | ||
| 154 | + return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1 | ||
| 150 | } | 155 | } |
| 151 | }, | 156 | }, |
| 152 | }; | 157 | }; |
-
请 注册 或 登录 后发表评论