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