diff --git a/app.py b/app.py index 3694355..ea47242 100644 --- a/app.py +++ b/app.py @@ -305,7 +305,7 @@ def login(): if check_password_hash(settings['admin_password_hash'], password): session['username'] = username next_url = request.args.get('next', url_for('navigation')) # 默认跳转到首页 - flash('登录成功', 'success') + # 移除flash消息,因为登录成功不需要显示 return redirect(next_url) flash('用户名或密码错误', 'danger') diff --git a/templates/login.html b/templates/login.html index cf51656..24740a7 100644 --- a/templates/login.html +++ b/templates/login.html @@ -136,10 +136,12 @@ {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %} -