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