From 2f62b12b734e38fa86112765b8dd22f8b9b61cc2 Mon Sep 17 00:00:00 2001 From: "suguo.yao" Date: Tue, 18 Oct 2022 13:28:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=B9=B3=EF=BC=8C=E9=99=90=E5=88=B6?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=EF=BC=8C=E5=8D=B3=E9=99=90=E5=88=B6=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/site-service.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/service/site-service.go b/service/site-service.go index 25b1251..6fffde7 100644 --- a/service/site-service.go +++ b/service/site-service.go @@ -50,6 +50,15 @@ func siteAccess(uri *string) error { description, _ = s.Attr("content") } }) + + //保持公平,长度限制 + if len(title) > 20 { + title = title[:20] + } + if len(description) > 200 { + description = description[:200] + } + if title != "" { id := uint32(crc32.ChecksumIEEE([]byte(*uri))) r := strings.Split(*uri, ".")