From 6db6b455a640f235ced9bbaa75a9f8b028a32be3 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 24 Aug 2023 14:41:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=85=AC=E4=BC=9A=20?= =?UTF-8?q?=E5=85=AC=E5=91=8A=E4=BF=AE=E6=94=B9=20=E9=93=AD=E6=84=9F?= =?UTF-8?q?=E8=AF=8D=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/sociaty/api_cross_setting.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/sociaty/api_cross_setting.go b/modules/sociaty/api_cross_setting.go index 070bf7042..51c526f4a 100644 --- a/modules/sociaty/api_cross_setting.go +++ b/modules/sociaty/api_cross_setting.go @@ -1,9 +1,11 @@ package sociaty import ( + "fmt" "go_dreamfactory/comm" "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" + "go_dreamfactory/sys/wordfilter" ) // 公会设置 @@ -30,6 +32,19 @@ func (this *apiComp) Setting(session comm.IUserSession, req *pb.SociatySettingRe } uid := session.GetUserId() + + //铭感词校验 工会公告 + if len(req.Notice) > 0 { + if iscompliance, inscriptionwords := wordfilter.Validate(req.Notice); !iscompliance { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_SociatyNoticeInscriptionWords, + Title: pb.ErrorCode_SociatyNoticeInscriptionWords.ToString(), + Message: fmt.Sprintf("工会公告包含铭感词:%s", inscriptionwords), + } + return + } + } + sociaty := this.module.modelSociaty.getUserSociaty(uid) if sociaty == nil { this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid})