28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
from django.urls import path, include
|
|
from rest_framework.routers import DefaultRouter
|
|
from .views import (
|
|
ParadiseUserViewSet, CustomRegisterView, PhoneLoginView,
|
|
SendVerifyCodeView, EmailLoginView, UsernameLoginView, MacAddressLoginView
|
|
)
|
|
|
|
router = DefaultRouter()
|
|
router.register('', ParadiseUserViewSet)
|
|
|
|
# 用户视图集的登录相关路径
|
|
urlpatterns = [
|
|
# 认证相关路径集中管理
|
|
path('auth/', include('userapp.auth_urls')),
|
|
# 注册相关
|
|
path('auth/register/', CustomRegisterView.as_view(), name='register'),
|
|
# 登录相关
|
|
path('auth/phone/login/', PhoneLoginView.as_view(), name='phone_login'),
|
|
path('auth/email/login/', EmailLoginView.as_view(), name='email_login'),
|
|
path('auth/username/login/', UsernameLoginView.as_view(), name='username_login'),
|
|
path('auth/mac/login/', MacAddressLoginView.as_view(), name='mac_login'),
|
|
# 手机验证码
|
|
path('auth/phone/verify/', SendVerifyCodeView.as_view(), name='send_verify_code'),
|
|
# 第三方账号相关
|
|
path('accounts/', include('allauth.urls')),
|
|
# 包含剩余的用户管理接口
|
|
path('', include(router.urls)),
|
|
] |