def index(): u = current_user() log("当前用户:", u) if u is None: abort(403) else: books = Book.find_all() return render_template('search.html', books=books, card_id=u.card_id)
def index(): u = current_user() log("当前用户:", u) books = Book.find_all() if u is None: card_id = "None" else: card_id = u.card_id return render_template('index.html', user=u, books=books, card_id=card_id)