|
|
@@ -119,20 +119,20 @@ def login_user_v3(request):
|
|
|
|
|
|
user = None
|
|
|
|
|
|
- if openid:
|
|
|
- user = cm.UserInfo.objects.filter(openid=openid).order_by("-id").first()
|
|
|
- else:
|
|
|
- if unionid or phone:
|
|
|
- user = cm.UserInfo.objects.filter(Q(phone=phone)|Q(unionid=unionid)).order_by("-id").first()
|
|
|
+ #if openid:
|
|
|
+ # user = cm.UserInfo.objects.filter(openid=openid).order_by("-id").first()
|
|
|
+ #else:
|
|
|
+ # if unionid or phone:
|
|
|
+ # user = cm.UserInfo.objects.filter(Q(phone=phone)|Q(unionid=unionid)).order_by("-id").first()
|
|
|
|
|
|
- #if unionid:
|
|
|
- # user = cm.UserInfo.objects.filter(unionid=unionid).order_by("-id").first()
|
|
|
+ if unionid:
|
|
|
+ user = cm.UserInfo.objects.filter(unionid=unionid).order_by("-id").first()
|
|
|
|
|
|
- #if not user and openid:
|
|
|
- # user = cm.UserInfo.objects.filter(openid=openid).order_by("-id").first()
|
|
|
+ if not user and openid:
|
|
|
+ user = cm.UserInfo.objects.filter(openid=openid).order_by("-id").first()
|
|
|
|
|
|
- #if not user and phone:
|
|
|
- # user = cm.UserInfo.objects.filter(phone=phone).order_by("-id").first()
|
|
|
+ if not user and phone:
|
|
|
+ user = cm.UserInfo.objects.filter(phone=phone).order_by("-id").first()
|
|
|
|
|
|
if not user:
|
|
|
#新用户
|
|
|
@@ -196,30 +196,30 @@ def get_wxauth_info_v3(request):
|
|
|
|
|
|
user = None
|
|
|
|
|
|
- if openid:
|
|
|
- user = cm.UserInfo.objects.filter(openid=openid).values().first()
|
|
|
- else:
|
|
|
- if phone:
|
|
|
- orgcode = ccc.cache.get(phone)
|
|
|
- if not phcode == orgcode and not phone=="13883187629":
|
|
|
- raise ce.TipException(u"验证码不正确!")
|
|
|
- user = cm.UserInfo.objects.filter(phone=phone).values().first()
|
|
|
- if unionid:
|
|
|
- user = cm.UserInfo.objects.filter(unionid=unionid).values().first()
|
|
|
-
|
|
|
- #if phone:
|
|
|
- # orgcode = ccc.cache.get(phone)
|
|
|
- # if not phcode == orgcode and not phone=="13883187629":
|
|
|
- # raise ce.TipException(u"验证码不正确!")
|
|
|
-
|
|
|
- #if unionid:
|
|
|
- # user = cm.UserInfo.objects.filter(unionid=unionid).values().first()
|
|
|
-
|
|
|
- #if not user and openid:
|
|
|
+ #if openid:
|
|
|
# user = cm.UserInfo.objects.filter(openid=openid).values().first()
|
|
|
+ #else:
|
|
|
+ # if phone:
|
|
|
+ # orgcode = ccc.cache.get(phone)
|
|
|
+ # if not phcode == orgcode and not phone=="13883187629":
|
|
|
+ # raise ce.TipException(u"验证码不正确!")
|
|
|
+ # user = cm.UserInfo.objects.filter(phone=phone).values().first()
|
|
|
+ # if unionid:
|
|
|
+ # user = cm.UserInfo.objects.filter(unionid=unionid).values().first()
|
|
|
+
|
|
|
+ if phone:
|
|
|
+ orgcode = ccc.cache.get(phone)
|
|
|
+ if not phcode == orgcode and not phone=="13883187629":
|
|
|
+ raise ce.TipException(u"验证码不正确!")
|
|
|
+
|
|
|
+ if unionid:
|
|
|
+ user = cm.UserInfo.objects.filter(unionid=unionid).values().first()
|
|
|
+
|
|
|
+ if not user and openid:
|
|
|
+ user = cm.UserInfo.objects.filter(openid=openid).values().first()
|
|
|
|
|
|
- #if not user and phone:
|
|
|
- # user = cm.UserInfo.objects.filter(phone=phone).values().first()
|
|
|
+ if not user and phone:
|
|
|
+ user = cm.UserInfo.objects.filter(phone=phone).values().first()
|
|
|
|
|
|
if not user:
|
|
|
return {}
|