29 lines
779 B
Python
29 lines
779 B
Python
|
|
# -*- coding: utf-8 -*-
|
||
|
|
"""
|
||
|
|
测试Flask应用路由
|
||
|
|
"""
|
||
|
|
from src.flask_prompt_master import create_app
|
||
|
|
|
||
|
|
def test_flask_routes():
|
||
|
|
"""测试Flask应用路由"""
|
||
|
|
app = create_app()
|
||
|
|
|
||
|
|
print("=" * 60)
|
||
|
|
print("Flask应用路由检查")
|
||
|
|
print("=" * 60)
|
||
|
|
|
||
|
|
print("📋 注册的路由:")
|
||
|
|
for rule in app.url_map.iter_rules():
|
||
|
|
print(f" {rule.rule} -> {rule.endpoint}")
|
||
|
|
|
||
|
|
print(f"\n📊 总路由数: {len(list(app.url_map.iter_rules()))}")
|
||
|
|
|
||
|
|
# 检查认证相关路由
|
||
|
|
auth_routes = [rule for rule in app.url_map.iter_rules() if 'auth' in rule.endpoint]
|
||
|
|
print(f"\n🔐 认证相关路由:")
|
||
|
|
for rule in auth_routes:
|
||
|
|
print(f" {rule.rule} -> {rule.endpoint}")
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
test_flask_routes()
|