fix: fix
This commit is contained in:
@@ -7,8 +7,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"unicode"
|
|
||||||
"unicode/utf8"
|
|
||||||
|
|
||||||
"github.com/go-rod/rod"
|
"github.com/go-rod/rod"
|
||||||
"github.com/go-rod/rod/lib/input"
|
"github.com/go-rod/rod/lib/input"
|
||||||
@@ -57,11 +55,6 @@ func (p *PublishAction) Publish(ctx context.Context, content PublishImageContent
|
|||||||
return errors.New("图片不能为空")
|
return errors.New("图片不能为空")
|
||||||
}
|
}
|
||||||
|
|
||||||
trimmedContent := strings.TrimRightFunc(content.Content, unicode.IsSpace)
|
|
||||||
if utf8.RuneCountInString(trimmedContent) > 1000 {
|
|
||||||
return errors.New("正文内容不能超过1000个字符")
|
|
||||||
}
|
|
||||||
|
|
||||||
page := p.page.Context(ctx)
|
page := p.page.Context(ctx)
|
||||||
|
|
||||||
if err := uploadImages(page, content.ImagePaths); err != nil {
|
if err := uploadImages(page, content.ImagePaths); err != nil {
|
||||||
@@ -440,4 +433,4 @@ func isElementVisible(elem *rod.Element) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return visible
|
return visible
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user