Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
sun
Commits
b30bae41
Commit
b30bae41
authored
Dec 01, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善用户
parent
04d2faa9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
user.py
api/user.py
+4
-3
UserDetail.vue
vu/src/views/user/components/UserDetail.vue
+0
-0
No files found.
api/user.py
View file @
b30bae41
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
# __author__ = "chenwei"
# __author__ = "chenwei"
# Date: 2018/11/15
# Date: 2018/11/15
import
json
from
utils.base
import
APIView
from
utils.base
import
APIView
from
utils.time_utils
import
generate_id
from
utils.time_utils
import
generate_id
...
@@ -34,7 +35,7 @@ class UserUpdateOrCreate(APIView):
...
@@ -34,7 +35,7 @@ class UserUpdateOrCreate(APIView):
def
post
(
self
,
request
):
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
,
''
)
id
=
request
.
POST
.
get
(
'id'
,
''
)
user_id
=
request
.
POST
.
get
(
'user_id'
,
''
)
user_id
=
request
.
POST
.
get
(
'user_id'
,
''
)
tag_ids
=
list
(
set
(
request
.
POST
.
get
(
'tag_ids'
)
.
split
(
','
)))
tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'tags'
,
'[]'
)
)))
if
not
user_id
:
if
not
user_id
:
user_id
=
generate_id
()
user_id
=
generate_id
()
data
=
{
data
=
{
...
@@ -42,9 +43,9 @@ class UserUpdateOrCreate(APIView):
...
@@ -42,9 +43,9 @@ class UserUpdateOrCreate(APIView):
'is_recommend'
:
request
.
POST
.
get
(
'is_recommend'
),
'is_recommend'
:
request
.
POST
.
get
(
'is_recommend'
),
'profile_pic'
:
request
.
POST
.
get
(
'avatar'
)[:
-
2
],
'profile_pic'
:
request
.
POST
.
get
(
'avatar'
)[:
-
2
],
'nick_name'
:
request
.
POST
.
get
(
'nick_name'
),
'nick_name'
:
request
.
POST
.
get
(
'nick_name'
),
'tag_ids'
:
list
(
filter
(
lambda
x
:
x
,
tag_ids
))
,
'tag_ids'
:
tag_ids
,
'is_puppet'
:
request
.
POST
.
get
(
'is_puppet'
),
'is_puppet'
:
request
.
POST
.
get
(
'is_puppet'
),
'city_id'
:
request
.
POST
.
get
(
'city'
)
,
'city_id'
:
request
.
POST
.
get
(
'city'
,
''
)
.
split
(
":"
)[
0
]
,
'phone'
:
request
.
POST
.
get
(
'phone'
),
'phone'
:
request
.
POST
.
get
(
'phone'
),
'email'
:
request
.
POST
.
get
(
'email'
),
'email'
:
request
.
POST
.
get
(
'email'
),
'gender'
:
request
.
POST
.
get
(
'gender'
),
'gender'
:
request
.
POST
.
get
(
'gender'
),
...
...
vu/src/views/user/components/UserDetail.vue
View file @
b30bae41
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment