Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task01 #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.7"
20 changes: 20 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions backend/bluewhale/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@
path(f'{api_prefix}/register', register, name='register'),
path(f'{api_prefix}/me', get_user_info, name='user profile'),

path(f'{api_prefix}/me/add',add_user_info,name='user profile'),
path(f'{api_prefix}/me/delete',del_user_info,name='user profile'),
path(f'{api_prefix}/me/update',update_user_info,name='user profile'),

path(f'{api_prefix}/articles', ArticleListCreateView.as_view(), name='articles'),
path(f'{api_prefix}/articles/<pk>', ArticleDetailView.as_view(), name='article'),
path(f'{api_prefix}/', include(router.urls)),

]
8 changes: 8 additions & 0 deletions backend/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ class User(AbstractBaseUser, PermissionsMixin):
help_text=_('Designates whether this user should be treated as active. '
'Unselect this instead of deleting accounts.'),
)
#添加
user_img = models.CharField(max_length=255,verbose_name="头像",default='')
wx_num = models.CharField(max_length=50,verbose_name='微信号',default='')
school = models.CharField(max_length=255,verbose_name='学校',default='')
major = models.CharField(max_length=255,verbose_name="专业",default='')
gs = models.CharField(max_length=255,verbose_name='公司',default='')
zw = models.CharField(max_length=255,verbose_name='职位',default='')

date_joined = models.DateTimeField(_('date joined'), default=timezone.now)
description = models.TextField(_('description'), blank=True)
last_login_ip = models.CharField(_('last login ip'), max_length=64, blank=True)
Expand Down
12 changes: 12 additions & 0 deletions backend/core/views_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.contrib.auth import login as django_login
import django.core.exceptions
from django.conf import settings
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy as _
from itsdangerous import URLSafeTimedSerializer
from rest_auth.views import LoginView
Expand Down Expand Up @@ -124,3 +125,14 @@ def register(request):
user.save()
django_login(request, user)
return Response({"data": UserSerializer(user).data, "code": 0}, status=status.HTTP_201_CREATED)


#updated for task02
def add_user_info(request):
return HttpResponse("add_user_info")

def del_user_info(request):
return HttpResponse("del_user_info")

def update_user_info(request):
return HttpResponse("update_user_info")
133 changes: 81 additions & 52 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.7.0"
},
"gitHooks": {
},
"gitHooks": {},
"lint-staged": {
"*.{js,jsx,vue}": [
"vue-cli-service lint",
Expand Down
Loading