Beispiel #1
0
def do_login():
    """后台管理登陆逻辑"""
    account = request.forms.get("username")
    password = request.forms.get("password")

    remmeber_me(account)
    check_account(account, password)
    manager = find_manager({"account": account, "password": md5(password)})
    if not manager:
        redirect("/manage/login")

    set_session("account", account)
    redirect("/manage/dashboard")
Beispiel #2
0
def do_login():
    '''后台管理登陆逻辑'''
    account = request.forms.get('username')
    password = request.forms.get('password')

    remmeber_me(account)
    check_account(account, password)
    manager = find_manager({"account": account, "password": md5(password)})
    if not manager:
        redirect('/manage/login')

    set_session('account', account)
    redirect('/manage/dashboard')
Beispiel #3
0
def find_manager(condition, **kwargs):
    """查找管理员用户"""
    from model.manager import find_one as find_manager

    return find_manager(condition, **kwargs)
Beispiel #4
0
def find_manager(condition, **kwargs):
    '''查找管理员用户'''
    from model.manager import find_one as find_manager
    return find_manager(condition, **kwargs)