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)
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)
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'))
def l_index(): form = Login_Form() return render_template('login.html', form=form)
def ssx_account_info(): form = Login_Form() return render_template('ssx_account_info.html', form=form)
def ssx_contact(): form = Login_Form() return render_template('ssx_contact.html', form=form)
def ssx_help(): form = Login_Form() return render_template('ssx_help.html', form=form)
def ssx_introduction(): form = Login_Form() return render_template('ssx_introduction.html', form=form)
def ssx_download(): form = Login_Form() return render_template('ssx_download.html', form=form)
def index(): form = Login_Form() # return render_template('login.html', form=form) return render_template('ssx_login.html', form=form)
def logout(): logout_user() flash('你已退出登录') form = Login_Form() return render_template('login.html', form=form)