fixed post picture comment failure error

pull/73/head
alimy 3 years ago
parent fe0412252b
commit 70c52c1e9c

@ -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
}
}

Loading…
Cancel
Save