From d66e3a85193e9c0b07faabcec337e19adafcda4f Mon Sep 17 00:00:00 2001 From: SugarMGP <2350745751@qq.com> Date: Mon, 2 Dec 2024 19:54:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=B9=E4=B8=8D=E5=90=88=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E6=A0=A1=E5=8C=BA=E5=8F=82=E6=95=B0=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/utils/campus.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/utils/campus.go b/app/utils/campus.go index a320ae4..6cc81a6 100644 --- a/app/utils/campus.go +++ b/app/utils/campus.go @@ -10,6 +10,9 @@ const ( func EncodeCampus(campus []uint) uint { var result uint for _, c := range campus { + if c > 3 || c == 0 { // 拦截错误参数 + continue + } result |= 1 << (c - 1) } return result