pull/5/head
youngS 4 years ago
parent 0c11effbe6
commit ab5034d898
  1. 2
      fir_client/src/components/FirRegist.vue
  2. 2
      fir_client/src/components/FirUserProfileInfo.vue
  3. 2
      fir_ser/api/utils/utils.py
  4. 25
      fir_ser/api/views/login.py

@ -183,7 +183,7 @@
type: 'error' type: 'error'
}); });
} }
}, {"methods": 'GET', 'data': {'act': act, 'target': this.form.email, 'ext': picode}}) }, {"methods": 'POST', 'data': {'act': act, 'target': this.form.email, 'ext': picode}})
} else { } else {
this.$message({ this.$message({

@ -341,7 +341,7 @@
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}, {"methods": 'GET', 'data': {'act': act, 'target': target, 'ext': picode}}) }, {"methods": 'POST', 'data': {'act': act, 'target': target, 'ext': picode}})
} }
}, mounted() { }, mounted() {
this.$store.dispatch('douserInfoIndex', 0); this.$store.dispatch('douserInfoIndex', 0);

@ -138,7 +138,7 @@ def is_valid_domain(value):
def is_valid_phone(value): def is_valid_phone(value):
phone_pat = re.compile('^(13\d|14[5|7]|15\d|166|17[3|6|7]|18\d)\d{8}$') phone_pat = re.compile('^(13\d|14[5|7]|15\d|166|17[3|6|7]|18\d)\d{8}$')
return True if value and re.search(phone_pat, value) else False return True if str(value) and re.search(phone_pat, str(value)) else False
def is_valid_email(email): def is_valid_email(email):

@ -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

Loading…
Cancel
Save