/// <summary> /// 获取api调用 /// </summary> /// <param name="tokenOpenId">访问令牌+用户身份的标识</param> /// <returns>API调用,失败返回null</returns> public api GetApiByJson(string tokenOpenId) { tokenOpenId value = new tokenOpenId(); return Laurent.Lee.CLB.Emit.TmphJsonParser.Parse(tokenOpenId, ref value) ? GetApi(value) : null; }
/// <summary> /// 获取api调用 /// </summary> /// <param name="tokenOpenId">访问令牌+用户身份的标识</param> /// <returns>API调用,失败返回null</returns> public api GetApi(tokenOpenId tokenOpenId) { if (tokenOpenId.Token.Length != 0 && tokenOpenId.OpenId.Length != 0) { return new api(this, new token { access_token = tokenOpenId.Token, expires_in = -1 }, new openId { openid = tokenOpenId.OpenId, client_id = client_id }); } return null; }