mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-04 22:02:26 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca293a4933 | ||
|
|
c82d73ca34 | ||
|
|
433064de00 | ||
|
|
9d71ca8198 |
@@ -2,6 +2,15 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [2.2.12](https://github.com/eiblog/eiblog/compare/v2.2.11...v2.2.12) (2024-01-02)
|
||||
|
||||
### [2.2.11](https://github.com/eiblog/eiblog/compare/v2.2.10...v2.2.11) (2024-01-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **disqus:** fix returned posts list not have parent post ([9d71ca8](https://github.com/eiblog/eiblog/commit/9d71ca81988bfc614d13fcb02079f0dba9ef43cc))
|
||||
|
||||
### [2.2.10](https://github.com/eiblog/eiblog/compare/v2.2.9...v2.2.10) (2023-12-22)
|
||||
|
||||
### [2.2.9](https://github.com/eiblog/eiblog/compare/v2.2.8...v2.2.9) (2023-09-25)
|
||||
|
||||
6
go.mod
6
go.mod
@@ -4,7 +4,7 @@ go 1.15
|
||||
|
||||
require (
|
||||
github.com/eiblog/blackfriday v0.0.0-20161010144836-c0ec111761ae
|
||||
github.com/gin-contrib/sessions v0.0.5
|
||||
github.com/gin-contrib/sessions v0.0.4
|
||||
github.com/gin-gonic/gin v1.9.1
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/qiniu/go-sdk/v7 v7.11.0
|
||||
@@ -13,9 +13,9 @@ require (
|
||||
github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14
|
||||
github.com/swaggo/gin-swagger v1.3.3
|
||||
github.com/swaggo/swag v1.7.4
|
||||
go.mongodb.org/mongo-driver v1.11.4
|
||||
go.mongodb.org/mongo-driver v1.5.4
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
gorm.io/driver/clickhouse v0.6.0
|
||||
gorm.io/driver/clickhouse v0.4.2
|
||||
gorm.io/driver/mysql v1.5.2
|
||||
gorm.io/driver/postgres v1.5.4
|
||||
gorm.io/driver/sqlite v1.5.4
|
||||
|
||||
@@ -204,7 +204,7 @@ func handleDisqusList(c *gin.Context) {
|
||||
if artc != nil {
|
||||
dcs.Data.Thread = artc.Thread
|
||||
}
|
||||
postsList, err := internal.PostsList(slug, cursor)
|
||||
postsList, err := internal.PostsList(artc, cursor)
|
||||
if err != nil {
|
||||
logrus.Error("hadnleDisqusList.PostsList: ", err)
|
||||
dcs.ErrNo = 0
|
||||
|
||||
@@ -17,11 +17,13 @@ import (
|
||||
// disqus api
|
||||
const (
|
||||
apiPostsCount = "https://disqus.com/api/3.0/threads/set.json"
|
||||
apiPostsList = "https://disqus.com/api/3.0/threads/listPosts.json"
|
||||
apiPostsList = "https://disqus.com/api/3.0/threads/listPostsThreaded"
|
||||
apiPostCreate = "https://disqus.com/api/3.0/posts/create.json"
|
||||
apiPostApprove = "https://disqus.com/api/3.0/posts/approve.json"
|
||||
apiThreadCreate = "https://disqus.com/api/3.0/threads/create.json"
|
||||
apiThreadDetails = "https://disqus.com/api/3.0/threads/details.json"
|
||||
|
||||
disqusAPIKey = "E8Uh5l5fHZ6gD8U3KycjAIAk46f68Zw7C6eW8WSjZvCLXebZ7p0r1yrYDrLilk2F"
|
||||
)
|
||||
|
||||
func checkDisqusConfig() error {
|
||||
@@ -123,16 +125,17 @@ type postDetail struct {
|
||||
}
|
||||
|
||||
// PostsList 评论列表
|
||||
func PostsList(slug, cursor string) (*PostsListResp, error) {
|
||||
func PostsList(article *model.Article, cursor string) (*PostsListResp, error) {
|
||||
if err := checkDisqusConfig(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
vals := url.Values{}
|
||||
vals.Set("api_key", config.Conf.EiBlogApp.Disqus.PublicKey)
|
||||
vals.Set("api_key", disqusAPIKey)
|
||||
vals.Set("forum", config.Conf.EiBlogApp.Disqus.ShortName)
|
||||
vals.Set("thread:ident", "post-"+slug)
|
||||
vals.Set("thread", article.Thread)
|
||||
vals.Set("cursor", cursor)
|
||||
vals.Set("order", "popular")
|
||||
vals.Set("limit", "50")
|
||||
|
||||
resp, err := httpGet(apiPostsList + "?" + vals.Encode())
|
||||
@@ -181,7 +184,7 @@ func PostCreate(pc *PostComment) (*PostCreateResp, error) {
|
||||
return nil, err
|
||||
}
|
||||
vals := url.Values{}
|
||||
vals.Set("api_key", "E8Uh5l5fHZ6gD8U3KycjAIAk46f68Zw7C6eW8WSjZvCLXebZ7p0r1yrYDrLilk2F")
|
||||
vals.Set("api_key", disqusAPIKey)
|
||||
vals.Set("message", pc.Message)
|
||||
vals.Set("parent", pc.Parent)
|
||||
vals.Set("thread", pc.Thread)
|
||||
|
||||
Reference in New Issue
Block a user