feat: 添加学员目标API和目标管理页面
This commit is contained in:
+10
-2
@@ -1,9 +1,17 @@
|
||||
from flask import Blueprint, request, jsonify
|
||||
from flask import Blueprint, request, jsonify, render_template
|
||||
from app.models import db, Goal
|
||||
from app.routes.auth import login_required_json
|
||||
from app.routes.auth import login_required_json, admin_required
|
||||
from app.routes import main_bp
|
||||
|
||||
goals_bp = Blueprint("goals", __name__)
|
||||
|
||||
# 目标管理页面路由
|
||||
@main_bp.route("/goals")
|
||||
@admin_required
|
||||
def goals_page():
|
||||
"""目标管理页面"""
|
||||
return render_template("goals.html", active_nav="goals")
|
||||
|
||||
@goals_bp.route("/api/goals", methods=["GET"])
|
||||
@login_required_json
|
||||
def get_goals():
|
||||
|
||||
Reference in New Issue
Block a user