diff --git a/backend/app/models/users.go b/backend/app/models/users.go index 9bbaa26..dc1a5ea 100644 --- a/backend/app/models/users.go +++ b/backend/app/models/users.go @@ -2,6 +2,7 @@ package models import ( "context" + "errors" "time" "quyun/app/requests" @@ -9,6 +10,7 @@ import ( "quyun/database/schemas/public/table" . "github.com/go-jet/jet/v2/postgres" + "github.com/go-jet/jet/v2/qrm" "github.com/samber/lo" "github.com/sirupsen/logrus" ) @@ -299,6 +301,9 @@ func (m *usersModel) HasBought(ctx context.Context, userID, postID int64) (bool, var userPost model.UserPosts if err := stmt.QueryContext(ctx, db, &userPost); err != nil { + if errors.Is(err, qrm.ErrNoRows) { + return false, nil + } m.log.Errorf("error querying user post: %v", err) return false, err } diff --git a/frontend/wechat/src/App.vue b/frontend/wechat/src/App.vue index 01a0b42..a68421f 100644 --- a/frontend/wechat/src/App.vue +++ b/frontend/wechat/src/App.vue @@ -1,3 +1,5 @@ - + + + \ No newline at end of file diff --git a/frontend/wechat/src/views/ArticleDetail.vue b/frontend/wechat/src/views/ArticleDetail.vue index 24a80ce..6975366 100644 --- a/frontend/wechat/src/views/ArticleDetail.vue +++ b/frontend/wechat/src/views/ArticleDetail.vue @@ -91,6 +91,10 @@ const fetchArticle = async () => { } } +const handleBack = () => { + router.back() +} + onMounted(async () => { await fetchArticle() initializePlayer() @@ -104,24 +108,34 @@ onUnmounted(() => { - - - - - Your browser does not support the video tag. - - - {{ article.title }} + + + + + + + + + + + + + + Your browser does not support the video tag. + + + {{ article.title }} + + + + + - - - - - + ¥{{ (article.price / 100).toFixed(2) }}