public ResultHandler Login(string name, string pwd) { ResultHandler res = new ResultHandler(); t_user model = _dal.GetUserByName(name); if (CommonFun.IsEmpty(model)) { res.state = false; res.message = "该用户不存在"; } else { if (!model.Pwd.Equals(pwd)) { res.state = false; res.message = "用户名或密码错误"; } else { res.state = true; res.message = "登录成功"; res.data = model; } } return(res); }
public string GetKindByName(string cust_name) { t_user model = _dal.GetUserByName(cust_name); if (CommonFun.IsEmpty(model)) { return(""); } else { return(model.Type); } }
public JsonResult Login(string name, string pwd, string url) { ResultHandler res = _user.Login(name, pwd); if (res.state) { if (!CommonFun.IsEmpty(Session["UserInfo"])) { Session.Remove("UserInfo"); } Session.Add("UserInfo", res.data); t_user item = res.data as t_user; if (CommonFun.IsEmpty(url)) { if ("General".Equals(item.Type)) { res.url = "sys/MyQR"; } else { res.url = "sys/index"; } } else { if ("General".Equals(item.Type)) { if (url.Contains("MyQR") || url.Contains("Client")) { res.url = url; } else { res.url = "sys/MyQR"; } } else { res.url = url; } } } return(Json(res)); }