获取access_token的代码如下:
from app.lib.common_function import * from app.lib.constant import weibo_api @app.route(YOUR_REDIRECT_URI) def page_weibo_login(): code = request.args.get("code") client = APIClient(app_key=weibo_api.client_id, app_secret=weibo_api.client_secret, redirect_uri=weibo_api.redirect_uri) access_token_dict = client.request_access_token(code, weibo_api.redirect_uri) return redirect("/link.html?access_token="+str(access_token_dict))