From 6692800851e643f2a58decb9d77ee27f133684b3 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期一, 29 九月 2025 18:03:38 +0800
Subject: [PATCH] 最新版本541200007
---
admin/src/main.js | 28 ++++++++++++++++++++++++----
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/admin/src/main.js b/admin/src/main.js
index 83b2a5e..a98f12b 100644
--- a/admin/src/main.js
+++ b/admin/src/main.js
@@ -45,10 +45,16 @@
return
}
await this.initRoutes()
+ },
+ async topMenuCurrent () {
+ if (this.topMenuCurrent == null) {
+ return
+ }
+ await this.chagneRoutes()
}
},
methods: {
- ...mapMutations(['switchCollapseMenu', 'setHomePage', 'setTopMenuCurrent', 'setTopMenuCurrent']),
+ ...mapMutations(['switchCollapseMenu', 'setHomePage', 'setTopMenuCurrent', 'setTopMenuCurrent','cleartagsview']),
// 鍒濆鍖栨湰鍦伴厤缃�
initLocalConfig () {
// 鑿滃崟鐘舵�侀厤缃�
@@ -79,9 +85,13 @@
})
storeTopMenus.push.apply(storeTopMenus, topList)
var topCurrent = null
+ var tlist =[]
topList.forEach(item => {
- if (item.linkType === 0 && topCurrent == null) {
- topCurrent = item
+ if (item.linkType === 0 ) {
+ if (topCurrent == null) {
+ topCurrent = item
+ }
+ tlist.push(...item.children)
}
})
this.setTopMenuCurrent(topCurrent)
@@ -96,7 +106,7 @@
console.log('menus', this.menuData.list)
storeMenus.push.apply(storeMenus, this.menuData.list)
// 娣诲姞璺敱
- this.__addRouters(storeMenus)
+ this.__addRouters(tlist)
// 404
router.addRoute({
path: '*',
@@ -120,6 +130,16 @@
this.loading = false
})
},
+ async chagneRoutes () {
+ // 閲嶇疆鑿滃崟
+ this.cleartagsview('/index')
+ console.log('menus', this.menuData.list)
+ // 娣诲姞璺敱
+ // this.__addRouters(this.menuData.list)
+ if(this.topMenuCurrent.homeUrl){
+ await this.$router.push({path: this.topMenuCurrent.homeUrl, query: {}})
+ }
+ },
// 鏂板缓璺敱
__addRouters (routes, parents = []) {
if (routes == null || routes.length === 0) {
--
Gitblit v1.9.3