i18n: reading dashboard announcements from custom tag
This commit is contained in:
parent
e705dedc22
commit
2a3759c315
2 changed files with 6 additions and 2 deletions
2
assets
2
assets
|
@ -1 +1 @@
|
|||
Subproject commit f11a53b8bf7abe6bac15d54df012a4b62755547a
|
||||
Subproject commit c0f8a7ef6ddd335b697347dce56271c3d3d8c215
|
|
@ -27,8 +27,12 @@ func AdminSummary(c *gin.Context) {
|
|||
|
||||
// AdminNews 获取社区新闻
|
||||
func AdminNews(c *gin.Context) {
|
||||
tag := "announcements"
|
||||
if c.Query("tag") != "" {
|
||||
tag = c.Query("tag")
|
||||
}
|
||||
r := request.NewClient()
|
||||
res := r.Request("GET", "https://forum.cloudreve.org/api/discussions?include=startUser%2ClastUser%2CstartPost%2Ctags&filter%5Bq%5D=%20tag%3Anotice&sort=-startTime&page%5Blimit%5D=10", nil)
|
||||
res := r.Request("GET", "https://forum.cloudreve.org/api/discussions?include=startUser%2ClastUser%2CstartPost%2Ctags&filter%5Bq%5D=%20tag%3A"+tag+"&sort=-startTime&page%5Blimit%5D=10", nil)
|
||||
if res.Err == nil {
|
||||
io.Copy(c.Writer, res.Response.Body)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue