Esempio n. 1
0
def login():
    form = Login_Form()
    if form.validate_on_submit():
        user = Users.query.filter_by(name=form.name.data).first()
        if user is not None and user.pwd == form.pwd.data:
            login_user(user)
            flash('登录成功')
            return render_template('ok.html', name=form.name.data)
        else:
            flash('用户或密码错误')
            return render_template('login.html', form=form)
Esempio n. 2
0
def login():
    form = Login_Form()
    if form.validate_on_submit():
        user = Users.query.filter_by(name=form.name.data).first()
        if user is not None and user.check_password_hash(form.pwd.data):
            login_user(user)
            flash('登录成功')
            return render_template('ssx_home.html', name=form.name.data)
        else:
            flash('用户名或密码错误')
            return render_template('ssx_login.html', form=form)
    return render_template('ssx_login.html', form=form)
Esempio n. 3
0
def login():
    form = Login_Form()
    if form.validate_on_submit():
        user = Users.query.filter_by(name=form.name.data).first()
        if user is None:
            flash('Wrong username')
            return render_template('login.html', form=form)
        if user is not None and user.pwd != form.pwd.data:
            flash('Wrong password')
            return render_template('login.html', form=form)
        if user is not None and user.pwd == form.pwd.data:
            login_user(user)
            flash('Log in succeed')
            return redirect(url_for('pj6.ok'))
Esempio n. 4
0
def l_index():
    form = Login_Form()
    return render_template('login.html', form=form)
Esempio n. 5
0
def ssx_account_info():
    form = Login_Form()
    return render_template('ssx_account_info.html', form=form)
Esempio n. 6
0
def ssx_contact():
    form = Login_Form()
    return render_template('ssx_contact.html', form=form)
Esempio n. 7
0
def ssx_help():
    form = Login_Form()
    return render_template('ssx_help.html', form=form)
Esempio n. 8
0
def ssx_introduction():
    form = Login_Form()
    return render_template('ssx_introduction.html', form=form)
Esempio n. 9
0
def ssx_download():
    form = Login_Form()
    return render_template('ssx_download.html', form=form)
Esempio n. 10
0
def index():
    form = Login_Form()
    # return render_template('login.html', form=form)
    return render_template('ssx_login.html', form=form)
Esempio n. 11
0
def logout():
    logout_user()
    flash('你已退出登录')
    form = Login_Form()
    return render_template('login.html', form=form)