|
@@ -2,7 +2,6 @@ package controllers
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
- "fmt"
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"hongze/hongze_cygx/models"
|
|
|
"hongze/hongze_cygx/services"
|
|
@@ -596,24 +595,15 @@ func (this *HomeController) HeaderTab() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- list := make([]*models.HomeHeaderTab, 0)
|
|
|
+ list := new(models.HomeHeaderTabList)
|
|
|
if e = json.Unmarshal([]byte(conf.ConfigValue), &list); e != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "首页头部导航配置值解析失败, Err: " + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- // 搜索页
|
|
|
- resp := make([]*models.HomeHeaderTab, 0)
|
|
|
+ resp := list.Home
|
|
|
if searchPage == 1 {
|
|
|
- for i := range list {
|
|
|
- if list[i].Name == "最新" {
|
|
|
- continue
|
|
|
- }
|
|
|
- list[i].Name = fmt.Sprint("搜", list[i].Name)
|
|
|
- resp = append(resp, list[i])
|
|
|
- }
|
|
|
- } else {
|
|
|
- resp = list
|
|
|
+ resp = list.SearchPage
|
|
|
}
|
|
|
|
|
|
br.Ret = 200
|