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
1
Merge Requests
1
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
alpha
saturn
Commits
7c7a9472
Commit
7c7a9472
authored
Feb 16, 2019
by
zhanglu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'yingjie/ins_account_exist' into 'test'
Yingjie/ins account exist See merge request
!19
parents
a29f0313
64f654a6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
3 deletions
+34
-3
urls.py
api/urls.py
+1
-0
sensitive.py
api/utils/sensitive.py
+11
-2
user.py
api/views/user.py
+21
-0
requirements.txt
requirements.txt
+1
-1
No files found.
api/urls.py
View file @
7c7a9472
...
...
@@ -18,4 +18,5 @@ urlpatterns = [
# user
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/utils/sensitive.py
View file @
7c7a9472
...
...
@@ -93,11 +93,20 @@ class Sensitive(object):
if
not
data
or
"detail"
in
data
:
# 程序出错啦
return
action
=
data
.
get
(
"result"
,
{})
.
get
(
"action"
,
0
)
result
=
data
.
get
(
"result"
,
{})
if
result
:
action
=
result
.
get
(
"action"
,
0
)
else
:
action
=
0
if
action
==
0
or
action
==
1
:
# "通过"
return
[]
lables
=
data
.
get
(
"result"
,
{})
.
get
(
"labels"
,
[])
if
result
:
lables
=
result
.
get
(
"labels"
,
[])
else
:
lables
=
[]
for
lable
in
lables
:
hints
.
extend
(
lable
.
get
(
'details'
,
{})
.
get
(
"hint"
))
...
...
api/views/user.py
View file @
7c7a9472
import
json
from
api.views.base_view
import
BaseView
,
get_offset_count
...
...
@@ -38,3 +40,22 @@ class ShadowUserList(BaseView):
}
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
)
requirements.txt
View file @
7c7a9472
...
...
@@ -20,6 +20,6 @@ git+ssh://git@git.wanmeizhensuo.com/backend/gm-config.git@v0.1.2#egg=gm-config==
git+ssh://git@git.wanmeizhensuo.com/system/gm-tracer.git@v0.1.2
git+ssh://git@git.wanmeizhensuo.com/backend/gm-types.git@master
git+ssh://git@git.wanmeizhensuo.com/backend/gm-shield.git@1.0.0
git+ssh://git@git.wanmeizhensuo.com/alpha/alpha-types.git@
dev
git+ssh://git@git.wanmeizhensuo.com/alpha/alpha-types.git@
master
git+ssh://git@git.wanmeizhensuo.com/backend/gm-protocol.git@master
git+ssh://git@git.wanmeizhensuo.com/backend/gm-upload.git@v0.74
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