diff --git a/server/controllers/api/topic_controller.go b/server/controllers/api/topic_controller.go index e4ee7a23d..aba1c6558 100644 --- a/server/controllers/api/topic_controller.go +++ b/server/controllers/api/topic_controller.go @@ -25,8 +25,7 @@ type TopicController struct { Ctx iris.Context } -// 节点 -func (c *TopicController) GetNodes() *web.JsonResult { +func (c *TopicController) GetNode_navs() *web.JsonResult { nodes := []model.NodeResponse{ { NodeId: 0, @@ -46,6 +45,12 @@ func (c *TopicController) GetNodes() *web.JsonResult { return web.JsonData(nodes) } +// 节点 +func (c *TopicController) GetNodes() *web.JsonResult { + nodes := render.BuildNodes(services.TopicNodeService.GetNodes()) + return web.JsonData(nodes) +} + // 节点信息 func (c *TopicController) GetNode() *web.JsonResult { nodeId := params.FormValueInt64Default(c.Ctx, "nodeId", 0) diff --git a/site/pages/articles.vue b/site/pages/articles.vue index 75743ae33..9592315fc 100644 --- a/site/pages/articles.vue +++ b/site/pages/articles.vue @@ -18,12 +18,11 @@ export default { async asyncData({ $axios, store }) { try { - const [nodes, scoreRank, links] = await Promise.all([ - $axios.get('/api/topic/nodes'), + const [scoreRank, links] = await Promise.all([ $axios.get('/api/user/score/rank'), $axios.get('/api/link/toplinks'), ]) - return { nodes, scoreRank, links } + return { scoreRank, links } } catch (e) { console.error(e) } diff --git a/site/pages/index.vue b/site/pages/index.vue index 22a1b796b..5e6d700f8 100644 --- a/site/pages/index.vue +++ b/site/pages/index.vue @@ -33,7 +33,7 @@ export default { store.commit('env/setCurrentNodeId', 0) // 设置当前所在node try { const [nodes, topicsPage, scoreRank, links] = await Promise.all([ - $axios.get('/api/topic/nodes'), + $axios.get('/api/topic/node_navs'), $axios.get('/api/topic/topics'), $axios.get('/api/user/score/rank'), $axios.get('/api/link/toplinks'), diff --git a/site/pages/topics.vue b/site/pages/topics.vue index fd6b2e6cb..697e27d7d 100644 --- a/site/pages/topics.vue +++ b/site/pages/topics.vue @@ -23,7 +23,7 @@ export default { try { store.commit('env/setCurrentNodeId', 0) // 设置当前所在node const [nodes, scoreRank, links] = await Promise.all([ - $axios.get('/api/topic/nodes'), + $axios.get('/api/topic/node_navs'), $axios.get('/api/user/score/rank'), $axios.get('/api/link/toplinks'), ])