web应用登陆验证代码
def login(username, password):
# 根据用户名查询数据库
user = User.query.filter_by(username=username).first()
if user:
# 验证密码
if check_password_hash(user.password, password):
return True
return False
3.91KB
文件大小:
评论区