|
|
@ -445,16 +445,15 @@ class UserInfoView(APIView): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AuthorizationView(APIView): |
|
|
|
class AuthorizationView(APIView): |
|
|
|
def get(self, request): |
|
|
|
|
|
|
|
|
|
|
|
def post(self, request): |
|
|
|
res = BaseResponse() |
|
|
|
res = BaseResponse() |
|
|
|
res.data = {} |
|
|
|
res.data = {} |
|
|
|
act = request.query_params.get("act", None) |
|
|
|
act = request.data.get("act", None) |
|
|
|
target = request.query_params.get("target", None) |
|
|
|
target = request.data.get("target", None) |
|
|
|
ext = request.query_params.get("ext", None) |
|
|
|
ext = request.data.get("ext", None) |
|
|
|
if ext: |
|
|
|
|
|
|
|
ext = json.loads(ext) |
|
|
|
|
|
|
|
register_type = get_register_type() |
|
|
|
register_type = get_register_type() |
|
|
|
if register_type.get('code') and ext and ext.get('icode'): |
|
|
|
if ext and register_type.get('code', None) and ext.get('icode', None): |
|
|
|
if ext.get('icode') == '689888666': |
|
|
|
if ext.get('icode') == '689888666': |
|
|
|
pass |
|
|
|
pass |
|
|
|
else: |
|
|
|
else: |
|
|
@ -467,7 +466,7 @@ class AuthorizationView(APIView): |
|
|
|
if ext and is_valid: |
|
|
|
if ext and is_valid: |
|
|
|
pass |
|
|
|
pass |
|
|
|
else: |
|
|
|
else: |
|
|
|
res.code = 1008 |
|
|
|
res.code = 1018 |
|
|
|
res.msg = "图片验证码有误" |
|
|
|
res.msg = "图片验证码有误" |
|
|
|
return Response(res.dict) |
|
|
|
return Response(res.dict) |
|
|
|
|
|
|
|
|
|
|
@ -479,14 +478,12 @@ class AuthorizationView(APIView): |
|
|
|
class ChangeAuthorizationView(APIView): |
|
|
|
class ChangeAuthorizationView(APIView): |
|
|
|
authentication_classes = [ExpiringTokenAuthentication, ] |
|
|
|
authentication_classes = [ExpiringTokenAuthentication, ] |
|
|
|
|
|
|
|
|
|
|
|
def get(self, request): |
|
|
|
def post(self, request): |
|
|
|
res = BaseResponse() |
|
|
|
res = BaseResponse() |
|
|
|
res.data = {} |
|
|
|
res.data = {} |
|
|
|
act = request.query_params.get("act", None) |
|
|
|
act = request.data.get("act", None) |
|
|
|
target = request.query_params.get("target", None) |
|
|
|
target = request.data.get("target", None) |
|
|
|
ext = request.query_params.get("ext", None) |
|
|
|
ext = request.data.get("ext", None) |
|
|
|
if ext: |
|
|
|
|
|
|
|
ext = json.loads(ext) |
|
|
|
|
|
|
|
if REGISTER.get("captcha"): |
|
|
|
if REGISTER.get("captcha"): |
|
|
|
if ext and valid_captcha(ext.get("cptch_key", None), ext.get("authcode", None), target): |
|
|
|
if ext and valid_captcha(ext.get("cptch_key", None), ext.get("authcode", None), target): |
|
|
|
pass |
|
|
|
pass |
|
|
|