factory/apps/auth1/urls.py

21 lines
1.2 KiB
Python
Executable File

from atexit import register
from django.urls import path
from rest_framework_simplejwt.views import (TokenObtainPairView,
TokenRefreshView)
from apps.auth1.views import CodeLogin, GetTokenFromCache, LoginView, LogoutView, SendCode, TokenBlackView, WxLogin, WxmpLogin
API_BASE_URL = 'api/auth/'
urlpatterns = [
path(API_BASE_URL + 'token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
path(API_BASE_URL + 'token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
path(API_BASE_URL + 'token/black/', TokenBlackView.as_view(), name='token_black'),
path(API_BASE_URL + 'login/', LoginView.as_view(), name='session_login'),
path(API_BASE_URL + 'login_wxmp/', WxmpLogin.as_view(), name='login_wxmp'),
path(API_BASE_URL + 'login_wx/', WxLogin.as_view(), name='login_wx'),
path(API_BASE_URL + 'login_sms_code/', CodeLogin.as_view(), name='login_sms_code'),
path(API_BASE_URL + 'sms_code/', SendCode.as_view(), name='sms_code_send'),
path(API_BASE_URL + 'code_cache_token/', GetTokenFromCache.as_view(), name='code_cache_token'),
path(API_BASE_URL + 'logout/', LogoutView.as_view(), name='session_logout'),
]