Example #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
Example #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
Example #3
0
 def createJsApiTicketBean(self):
     constant = BaseConstant()
     apiTicket = JssdkApiTicket()
     apiTicket.setAppId(constant.getAppId())
     apiTicket.setNonceStr(self.getNonceStr())
     apiTicket.setTimestamp(self.getTimestamp())
     apiTicket.setJsapiTicket(self.getJsapiTicket())
     return apiTicket