xjconline 2 tahun lalu
induk
melakukan
c48e42363d
2 mengubah file dengan 6 tambahan dan 3 penghapusan
  1. 5 2
      src/weixin/control_auth.py
  2. 1 1
      templates/index.html

+ 5 - 2
src/weixin/control_auth.py

@@ -117,8 +117,11 @@ def login_user_v3(request):
     #    raise ce.TipException(u"非法openid!")
 
     user = None
-    if phone or unionid or openid:
-        user = cm.UserInfo.objects.filter(Q(phone=phone)|Q(unionid=unionid)|Q(openid=openid)).order_by("-id").first()
+    if openid:
+        user = cm.UserInfo.objects.filter(openid=openid).order_by("-id").first()
+    else:
+        if unionid or openid:
+            user = cm.UserInfo.objects.filter(Q(phone=phone)|Q(unionid=unionid)).order_by("-id").first()
 
     if not user:
         #新用户

File diff ditekan karena terlalu besar
+ 1 - 1
templates/index.html