- 添加用户登录、登出及令牌管理功能 - 实现基于JWT和Redis的认证系统 - 完善用户和角色管理API - 添加密码加密与验证功能 - 配置数据库连接和Redis客户端 - 实现中间件进行权限验证 - 初始化管理员和测试用户数据 - 更新模型和接口文档 - 添加测试API和配置文件
20 lines
592 B
Python
20 lines
592 B
Python
import urllib.request
|
|
|
|
# 测试根路径
|
|
print("Testing root path...")
|
|
try:
|
|
response = urllib.request.urlopen('http://127.0.0.1:8000/')
|
|
print(f"Status code: {response.status}")
|
|
print(f"Response: {response.read().decode('utf-8')}")
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|
|
|
|
# 测试/docs路径
|
|
print("\nTesting /docs path...")
|
|
try:
|
|
response = urllib.request.urlopen('http://127.0.0.1:8000/docs')
|
|
print(f"Status code: {response.status}")
|
|
print(f"Response length: {len(response.read().decode('utf-8'))} characters")
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|