From 492974731a1f35dcfdb5767a9b36b88f6c84534d Mon Sep 17 00:00:00 2001 From: "suguo.yao" Date: Tue, 18 Oct 2022 17:18:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E6=96=87=E5=88=87=E7=89=87=E4=B9=B1?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/site-service.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/service/site-service.go b/service/site-service.go index 9a37bd3..c223292 100644 --- a/service/site-service.go +++ b/service/site-service.go @@ -52,11 +52,13 @@ func siteAccess(uri *string) error { }) //保持公平,长度限制 - if len(title) > 20 { - title = title[:20] + str := []rune(title) + if len(str) > 25 { + title = string(str[:25]) } - if len(description) > 200 { - description = description[:200] + str2 := []rune(description) + if len(str2) > 200 { + description = string(str2[:200]) } if title != "" {