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