public string ValidateMobile(ValidatePhoneNumber model) { // string syscode = .Instance.Get(model.Phone, randomCode); string CacheValue = ""; if (!string.IsNullOrEmpty(model.Phone)) { CacheValue = YG.SC.OpenShop.PCnCache.Instance.Get(model.Phone); } if (CacheValue == model.Code) { return("ok"); } return("-1"); }
public ValidatePhoneNumber ValidatePhoneNumber() { if (!string.IsNullOrWhiteSpace(Url)) { using (var client = new WebClient()) { string json = client.DownloadString(Url); ValidatePhoneNumber validatePhoneNumber = JsonConvert.DeserializeObject <ValidatePhoneNumber>(json); return(validatePhoneNumber); } } else { throw new InvalidOperationException(); } }