From 70c52c1e9ce97901933681a7b3f785190309c4c4 Mon Sep 17 00:00:00 2001 From: alimy Date: Wed, 8 Jun 2022 21:02:40 +0800 Subject: [PATCH] fixed post picture comment failure error --- internal/service/comment.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/service/comment.go b/internal/service/comment.go index 0d745eb8..7a70dd51 100644 --- a/internal/service/comment.go +++ b/internal/service/comment.go @@ -1,7 +1,6 @@ package service import ( - "strings" "time" "github.com/gin-gonic/gin" @@ -116,7 +115,7 @@ func CreatePostComment(ctx *gin.Context, userID int64, param CommentCreationReq) for _, item := range param.Contents { // 检查附件是否是本站资源 if item.Type == model.CONTENT_TYPE_IMAGE || item.Type == model.CONTENT_TYPE_VIDEO || item.Type == model.CONTENT_TYPE_ATTACHMENT { - if strings.Index(item.Content, "https://"+global.AliOSSSetting.Domain) != 0 { + if err := attachmentChecker.Check(item.Content); err != nil { continue } }