cors
This commit is contained in:
parent
b0c970b085
commit
006a639ef0
Binary file not shown.
|
@ -7,5 +7,5 @@ class UserFilter(filters.FilterSet):
|
||||||
model = User
|
model = User
|
||||||
fields = {
|
fields = {
|
||||||
'name': ['exact', 'contains'],
|
'name': ['exact', 'contains'],
|
||||||
'is_active': ['exact']
|
'is_active': ['exact'],
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ class PositionViewSet(ModelViewSet):
|
||||||
queryset = Position.objects.all()
|
queryset = Position.objects.all()
|
||||||
serializer_class = PositionSerializer
|
serializer_class = PositionSerializer
|
||||||
pagination_class = None
|
pagination_class = None
|
||||||
search_fields = ['^name']
|
search_fields = ['name','desc']
|
||||||
ordering_fields = ['id']
|
ordering_fields = ['id']
|
||||||
ordering = 'id'
|
ordering = 'id'
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ class UserViewSet(ModelViewSet):
|
||||||
serializer.save(password=password)
|
serializer.save(password=password)
|
||||||
return Response(serializer.data)
|
return Response(serializer.data)
|
||||||
|
|
||||||
@action(methods=['put'], detail=True, permission_classes=[IsAuthenticated],
|
@action(methods=['put'], detail=True, permission_classes=[IsAuthenticated], # perms_map={'put':'change_password'}
|
||||||
url_name='change_password')
|
url_name='change_password')
|
||||||
def password(self, request, pk=None):
|
def password(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
|
Binary file not shown.
|
@ -1,4 +0,0 @@
|
||||||
@echo off
|
|
||||||
call venv\scripts\activate.bat
|
|
||||||
celery -A server beat -l info
|
|
||||||
pause
|
|
|
@ -1,4 +0,0 @@
|
||||||
@echo off
|
|
||||||
call venv\scripts\activate.bat
|
|
||||||
celery -A server worker -l info -P eventlet
|
|
||||||
pause
|
|
|
@ -1,3 +0,0 @@
|
||||||
@echo off
|
|
||||||
call venv\scripts\activate.bat
|
|
||||||
python manage.py runserver
|
|
|
@ -161,6 +161,7 @@ SIMPLE_JWT = {
|
||||||
|
|
||||||
# 跨域配置
|
# 跨域配置
|
||||||
CORS_ORIGIN_ALLOW_ALL = True
|
CORS_ORIGIN_ALLOW_ALL = True
|
||||||
|
CORS_ALLOW_CREDENTIALS = False
|
||||||
|
|
||||||
# Auth配置
|
# Auth配置
|
||||||
AUTH_USER_MODEL = 'system.User'
|
AUTH_USER_MODEL = 'system.User'
|
||||||
|
|
Loading…
Reference in New Issue