public void SignUpSubmit() { if (string.IsNullOrEmpty(RegFullname.text) || !RegFullname.GetComponent <ValidateInput>().isValidInput) { RegFullname.GetComponent <ValidateInput>().Validate(RegFullname.text); } else if (string.IsNullOrEmpty(RegEmail.text) || !RegEmail.GetComponent <ValidateInput>().isValidInput) { RegEmail.GetComponent <ValidateInput>().Validate(RegEmail.text); } else if (string.IsNullOrEmpty(RegPhomenumber.text) || !RegPhomenumber.GetComponent <ValidateInput>().isValidInput) { RegPhomenumber.GetComponent <ValidateInput>().Validate(RegPhomenumber.text); } else { print("Signup Validate true"); emailid = RegEmail.text; fullname = RegFullname.text; phonecode = RegPhoneCode.value.ToString(); phonenumber = RegPhomenumber.text; LoaderPanel.gameObject.SetActive(true); WebRequestObject.ProcessSignUp(fullname, phonecode, phonenumber, emailid, RegisterCallback); } }
public ActionResult Index(FormCollection form) { var account = form["Account"]; var pasword = form["Password"]; var code = form["ValidateCode"]; if (string.IsNullOrWhiteSpace(account) || string.IsNullOrWhiteSpace(pasword) || string.IsNullOrWhiteSpace(code)) { return(Json(new { success = false, msg = "账户名/密码为空" }, JsonRequestBehavior.AllowGet)); } account = account.Trim(); pasword = pasword.Trim(); code = code.Trim(); if (!Captcha.CompareAndDestroy(Session, code)) { return(Json(new { success = false, msg = "验证码错误" }, JsonRequestBehavior.AllowGet)); } var tenant = new Tenant() { Account = account, AccountType = (int)TenantAccountType.Email, Password = pasword, Email = account, Owner = new DBC.WeChat.Models.Infrastructures.Store() { Enabled = false } }; var svc = ServiceLocator.Resolve <IModelService>("Internal"); try { svc.Create(tenant); tenant.CreatorID = null; tenant.LastModifiedAt = null; tenant.LastModifierID = null; RegEmail.Send(tenant, Request); Session["Tenant"] = tenant; } catch (RuleViolatedException ex) { return(Json(new { success = false, msg = ex.Message }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { success = false, msg = "未知错误" }, JsonRequestBehavior.AllowGet)); } return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 是否是以(com|cn|net|org|edu|mil|tv|biz|info)结尾的邮件地址 /// </summary> /// <param name="inputData">输入字符串</param> /// <returns></returns> public static bool IsAnMail(string inputData) { Match m = RegEmail.Match(inputData.ToLower()); return(m.Success); }