示例#1
0
def getOpenId(code):
    constant = BaseConstant()
    url = api_openid % (constant.getAppId(), constant.getAppSecret(), code)
    jsonStr = httpUtil.get(url)
    resultDic = json.loads(jsonStr)
    logging.warn(json.dumps(resultDic, ensure_ascii=False))
    return resultDic
示例#2
0
def getAccessToken():
    constant = BaseConstant()
    url = api_access_token % (constant.getAppId(), constant.getAppSecret())
    jsonStr = httpUtil.get(url)
    resultDic = json.loads(jsonStr)
    logging.warn(json.dumps(resultDic, ensure_ascii=False))
    return resultDic