public override void Signature() { base.noncestr = Guid.NewGuid().ToString().Replace("-", ""); base.timestamp = UnixTime.DateTimeToUnixTime(DateTime.Now); base.Signature(new string[] { $"noncestr={base.noncestr}", $"jsapi_ticket={this.ticket}", $"timestamp={base.timestamp}", $"url={this.url}" }); }
public override void Signature() { base.noncestr = Guid.NewGuid().ToString().Replace("-", ""); base.timestamp = UnixTime.DateTimeToUnixTime(DateTime.Now); base.Signature(new string[] { $"nonce_str={noncestr}", $"timestamp={timestamp}", $"api_ticket={ticket}", $"appid={appid}", $"location_id={location_id}", $"card_id={card_id}", $"card_type={card_type}" }); }
public override void Signature() { base.noncestr = Guid.NewGuid().ToString().Replace("-", ""); base.timestamp = UnixTime.DateTimeToUnixTime(DateTime.Now); List <string> list = new List <string>() { $"api_ticket={this.ticket}", $"nonce_str={base.noncestr}", $"timestamp={base.timestamp}", $"card_id={this.card_id}", }; if (!string.IsNullOrEmpty(code)) { list.Add($"code={this.code}"); } if (!string.IsNullOrEmpty(openid)) { list.Add($"openid={this.openid}"); } base.Signature(list.ToArray()); }
public override void Signature() { base.noncestr = Guid.NewGuid().ToString().Replace("-", ""); base.timestamp = UnixTime.DateTimeToUnixTime(DateTime.Now); string[] arr = new string[] { $"appId={this.appId}", $"timeStamp={base.timestamp}", $"nonceStr={base.noncestr}", $"package={this.package}", $"signType={this.sign_type}" }; Array.Sort(arr); string tmpStr = string.Join("&", arr); if (this.sign_type == null || this.sign_type.ToLower() == "md5") { base.signature = Cryptography.MD5Encrypt(tmpStr); } else { base.signature = Cryptography.Sha1Signature(tmpStr); } }