fix: 白名单校验改为不区分大小写
This commit is contained in:
@@ -43,9 +43,9 @@ def get_whitelist() -> list[str]:
|
||||
|
||||
|
||||
def is_whitelisted(user_id: str) -> bool:
|
||||
"""检查用户是否在 AI 白名单中"""
|
||||
"""检查用户是否在 AI 白名单中(不区分大小写)"""
|
||||
whitelist = get_whitelist()
|
||||
if not whitelist:
|
||||
# 白名单为空则所有人都可以操作
|
||||
return True
|
||||
return user_id in whitelist
|
||||
return user_id.lower() in [u.lower() for u in whitelist]
|
||||
|
||||
Reference in New Issue
Block a user