|
|
@@ -33,6 +33,7 @@
|
|
33
|
33
|
|
|
34
|
34
|
<script>
|
|
35
|
35
|
import { constantRoutes } from "@/router";
|
|
|
36
|
+import { isHttp } from "@/utils/validate";
|
|
36
|
37
|
|
|
37
|
38
|
// 隐藏侧边栏路由
|
|
38
|
39
|
const hideList = ['/index', '/user/profile'];
|
|
|
@@ -78,7 +79,7 @@ export default {
|
|
78
|
79
|
if(router.path === "/") {
|
|
79
|
80
|
router.children[item].path = "/" + router.children[item].path;
|
|
80
|
81
|
} else {
|
|
81
|
|
- if(!this.ishttp(router.children[item].path)) {
|
|
|
82
|
+ if(!isHttp(router.children[item].path)) {
|
|
82
|
83
|
router.children[item].path = router.path + "/" + router.children[item].path;
|
|
83
|
84
|
}
|
|
84
|
85
|
}
|
|
|
@@ -126,7 +127,7 @@ export default {
|
|
126
|
127
|
handleSelect(key, keyPath) {
|
|
127
|
128
|
this.currentIndex = key;
|
|
128
|
129
|
const route = this.routers.find(item => item.path === key);
|
|
129
|
|
- if (this.ishttp(key)) {
|
|
|
130
|
+ if (isHttp(key)) {
|
|
130
|
131
|
// http(s):// 路径新窗口打开
|
|
131
|
132
|
window.open(key, "_blank");
|
|
132
|
133
|
} else if (!route || !route.children) {
|
|
|
@@ -160,9 +161,6 @@ export default {
|
|
160
|
161
|
} else {
|
|
161
|
162
|
this.$store.dispatch('app/toggleSideBarHide', true);
|
|
162
|
163
|
}
|
|
163
|
|
- },
|
|
164
|
|
- ishttp(url) {
|
|
165
|
|
- return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
|
|
166
|
164
|
}
|
|
167
|
165
|
},
|
|
168
|
166
|
};
|