Browse Source

Merge branch 'feature/v4.8.31_wky' of qmx/jy into feature/v4.8.31

wangkaiyue 2 years ago
parent
commit
087e6828f9
2 changed files with 9 additions and 18 deletions
  1. 2 2
      src/jfw/front/pcIndex.go
  2. 7 16
      src/jfw/tag/menu.go

+ 2 - 2
src/jfw/front/pcIndex.go

@@ -30,8 +30,8 @@ const (
 type PcIndex struct {
 	*xweb.Action
 	newSordfish   xweb.Mapper `xweb:"/(old|)"`                  //剑鱼标讯pc首页
-	brandIndex    xweb.Mapper `xweb:"/brand/index"`             //品牌网站首页
-	brandIndexOld xweb.Mapper `xweb:"/brand/index_old"`         //品牌网站首页
+	brandIndex    xweb.Mapper `xweb:"/brand"`                   //品牌网站首页
+	brandIndexOld xweb.Mapper `xweb:"/brand/index"`             //品牌网站首页
 	productIndex  xweb.Mapper `xweb:"/product/index"`           //品牌网站首页
 	newSordfishC  xweb.Mapper `xweb:"/pcindex.html"`            //剑鱼标讯pc首页-统计
 	searchResult  xweb.Mapper `xweb:"/list/(\\w+)/(\\w+).html"` //剑鱼标讯分类 地区结果列表

+ 7 - 16
src/jfw/tag/menu.go

@@ -61,23 +61,15 @@ func AllMenuCache() (cache *MenuCache) {
 	}
 	cache.BottomLinkMap, cache.TopMenuMap = map[int][]*TopMenuItem{}, map[int][]*TopMenuItem{}
 	for _, menu := range cache.AllMenu {
-		if len(menu.TopMenu) == 0 {
-			//默认主站展示
-			cache.TopMenuMap[mainSite] = append(cache.TopMenuMap[mainSite], menu)
-		} else {
-			for _, value := range menu.TopMenu {
-				cache.TopMenuMap[value] = append(cache.TopMenuMap[value], menu)
-			}
+
+		for _, value := range menu.TopMenu {
+			cache.TopMenuMap[value] = append(cache.TopMenuMap[value], menu)
 		}
 
-		if len(menu.BottomLink) == 0 {
-			//默认主站底部展示
-			cache.BottomLinkMap[mainSite] = append(cache.BottomLinkMap[mainSite], menu)
-		} else {
-			for _, value := range menu.BottomLink {
-				cache.BottomLinkMap[value] = append(cache.BottomLinkMap[value], menu)
-			}
+		for _, value := range menu.BottomLink {
+			cache.BottomLinkMap[value] = append(cache.BottomLinkMap[value], menu)
 		}
+
 	}
 
 	redis.Put("other", cacheKey, cache, -1)
@@ -89,7 +81,7 @@ func (mc *MenuCache) GetSite(url string, isTopMenu bool) int {
 	//配置文件
 	if url == "/" {
 		return mainSite
-	} else if url == "/brand/index" {
+	} else if url == "/brand" {
 		return brandFlag
 	}
 
@@ -102,7 +94,6 @@ func (mc *MenuCache) GetSite(url string, isTopMenu bool) int {
 			} else {
 				sites = item.BottomLink
 			}
-
 			break
 		}
 		for _, c := range item.Child {