ymao 4 years ago
parent
commit
9f4cbd043b
4 changed files with 8 additions and 8 deletions
  1. 4 4
      authen/wxlogin/login.py
  2. 1 1
      authen/wxlogin/wraps.py
  3. 1 1
      authen/wxlogin/wx.py
  4. 2 2
      setup.py

+ 4 - 4
authen/wxlogin/login.py

@@ -7,7 +7,7 @@ import datetime
 from flask import Blueprint, url_for, redirect, \
     request, current_app
 
-from .wx import wx_login
+from .wx import wxl
 
 
 bp = Blueprint("wxmp", __name__, template_folder="templates")
@@ -20,9 +20,9 @@ def wxmp_login():
         oauth_type = "snsapi_userinfo"
     next = request.args.get("next") or request.referrer or "/"
     callback = url_for(
-        ".wxmp_authorized",
+        "wxmp.wxmp_authorized",
         oauth_type=oauth_type, next=next, _external=True)
-    url = wx_login.authorize(urllib.quote(callback), oauth_type)
+    url = wxl.authorize(urllib.parse.quote(callback), oauth_type)
     return redirect(url)
 
 
@@ -33,7 +33,7 @@ def wxmp_authorized():
         return "ERR_INVALID_CODE", 400
     next = request.args.get("next", "/")
     oauth_type = request.args.get("oauth_type", "snsapi_userinfo")
-    data = wx_login.access_token(code)
+    data = wxl.access_token(code)
     # openid = data.openid
     # unionid = data.unionid
     resp = redirect(next)

+ 1 - 1
authen/wxlogin/wraps.py

@@ -28,7 +28,7 @@ def wxmp_base_login_required(func):
                     "wxmp.wxmp_login",
                     next="?".join([
                         request.path,
-                        urllib.urlencode(request.args)
+                        urllib.parse.urlencode(request.args)
                     ]),
                     oauth_type="snsapi_base")
             )

+ 1 - 1
authen/wxlogin/wx.py

@@ -179,4 +179,4 @@ class WeixinLogin(object):
         return self.userinfo(access_token, openid)
 
 
-wx_login = WeixinLogin()
+wxl = WeixinLogin()

+ 2 - 2
setup.py

@@ -4,8 +4,8 @@ from setuptools import setup, find_packages
 
 setup(
     name='authen.wxlogin',
-    version=0.33,
-    url='http://git.aoyanming.com/authen29/wxlogin/',
+    version=0.40,
+    url='http://git.trops-global.com/authen/trops_wxlogin.git',
     license='GPL',
     author='authen',
     author_email='295002887@qq.com',