This repository has been archived on 2023-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
web-gpt/project/main.py

20 lines
556 B
Python

from flask import Blueprint, render_template
from flask_login import login_required, current_user, login_manager
main = Blueprint('main', __name__)
@main.route('/')
def index():
if current_user.is_authenticated:
name = current_user.name
else:
name = '游客'
return render_template('index.html', username=name, is_authenticated=current_user.is_authenticated)
@main.route('/profile')
@login_required
def profile():
return render_template('profile.html', username=current_user.name, isActivated=current_user.isActivated)