@classmethod
def auth(cls, username, raw_password):
    """验证用户登录。如果登录成功，返回用户"""
    obj = cls.query.filter_by(username=username).first()
    if obj and obj.check_password(raw_password):
        return obj
    else:
        return None
