Skip to content

Commit

Permalink
Merge pull request #24 from zjutjh/SugarMGP/dev
Browse files Browse the repository at this point in the history
fix: 对不合法的校区参数进行拦截
  • Loading branch information
Penryn authored Dec 2, 2024
2 parents 530e12a + d66e3a8 commit 59d9d80
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/utils/campus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59d9d80

Please sign in to comment.