Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
saturn
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
赵磊
saturn
Commits
64f654a6
Commit
64f654a6
authored
Feb 16, 2019
by
张英杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
三方账号验证
parent
c8767792
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
urls.py
api/urls.py
+1
-0
user.py
api/views/user.py
+21
-0
No files found.
api/urls.py
View file @
64f654a6
...
@@ -18,4 +18,5 @@ urlpatterns = [
...
@@ -18,4 +18,5 @@ urlpatterns = [
# user
# user
url
(
r'^v1/user/shadow/list$'
,
user
.
ShadowUserList
.
as_view
(),
name
=
'create_tag_for_batch'
),
url
(
r'^v1/user/shadow/list$'
,
user
.
ShadowUserList
.
as_view
(),
name
=
'create_tag_for_batch'
),
url
(
r'^v1/validate_3party_account$'
,
user
.
Validate3PartyAccount
.
as_view
(),
name
=
'validate_3party_account$'
),
]
]
api/views/user.py
View file @
64f654a6
import
json
from
api.views.base_view
import
BaseView
,
get_offset_count
from
api.views.base_view
import
BaseView
,
get_offset_count
...
@@ -38,3 +40,22 @@ class ShadowUserList(BaseView):
...
@@ -38,3 +40,22 @@ class ShadowUserList(BaseView):
}
}
return
self
.
ok
(
data
=
result
)
return
self
.
ok
(
data
=
result
)
class
Validate3PartyAccount
(
BaseView
):
"""
验证三方账号是否已绑定过
"""
def
post
(
self
,
request
):
_ids
=
request
.
POST
.
get
(
"account_ids"
)
or
'[]'
account_ids
=
json
.
loads
(
_ids
)
err
,
_data
=
self
.
call_rpc
(
"venus/community/validate_has_bind_3party_account"
,
bind_account_ids
=
account_ids
)
if
err
:
return
self
.
error
(
err
)
data
=
{
account_id
:
_data
.
get
(
account_id
,
False
)
for
account_id
in
account_ids
}
return
self
.
ok
(
data
=
data
)
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