Commit 64f654a6 authored by 张英杰's avatar 张英杰

三方账号验证

parent c8767792
...@@ -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$'),
] ]
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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment