Skip to content

Commit bef231d

Browse files
committed
🎨 fixed b3log#104
1 parent ac29e4a commit bef231d

15 files changed

Lines changed: 26 additions & 18 deletions

File tree

‎console/pages/admin/index.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727
},
2828
async mounted () {
29-
const responseTagsData = await this.axios.get(`/console/tags`)
29+
const responseTagsData = await this.axios.get('/console/tags')
3030
if (responseTagsData) {
3131
let tags = ''
3232
responseTagsData.map((v, i) => {

‎console/pages/index.vue‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<div class="console" id="particles">
33
<div class="card" v-if="$store.state.role !== 0">
4-
<h2 class="card__title">{{ $t('welcome', $store.state.locale) }}</h2>
4+
<h2 class="card__title">Top 10</h2>
55
<ul class="list">
6-
<li class="fn-flex" v-for="item in $store.state.blogs">
6+
<li class="fn-flex" v-for="item in list">
77
<a class="fn-flex-1" :href="item.url">{{ item.title }}</a>
88
</li>
99
</ul>
@@ -30,7 +30,16 @@
3030
title: this.$t('welcome', this.$store.state.locale) + ' - Pipe'
3131
}
3232
},
33-
mounted () {
33+
data () {
34+
return {
35+
list: []
36+
}
37+
},
38+
async mounted () {
39+
const responseTopData = await this.axios.get('/blogs/top')
40+
if (responseTopData) {
41+
this.$set(this, 'list', responseTopData)
42+
}
3443
initParticlesJS('particles')
3544
}
3645
}

‎controller/router.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ func MapRoutes() *gin.Engine {
7070
ret.Use(sessions.Sessions("pipe", store))
7171
ret.POST(util.PathUpload, uploadAction)
7272
ret.GET(util.PathPlatInfo, showPlatInfo)
73-
ret.GET(util.PathTopBlogs, showTopBlogs)
7473

7574
api := ret.Group(util.PathAPI)
7675
api.POST("/init", initAction)
7776
api.POST("/logout", logoutAction)
7877
api.Any("/hp/*apis", util.HacPaiAPI())
7978
api.GET("/status", getStatusAction)
8079
api.GET("/check-version", console.CheckVersion)
80+
api.GET("/blogs/top", showTopBlogs)
8181

8282
consoleGroup := api.Group("/console")
8383
consoleGroup.Use(console.LoginCheck)

‎theme/sw.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/9IPHP/js/article.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/9IPHP/js/common.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/Gina/js/article.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/Gina/js/common.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/Koma/js/article.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/Koma/js/common.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)