protected void Page_Load(object sender, EventArgs e) { //token = "13052894185"; var result = new Sys.BLL.Account().CheckToken(token); if (result) { UtilLog.WriteTextLog("log test", token); userLoginId = token.Split('|')[0]; } else { Response.Write("<script>alert('Token验证失败');history.back(-1);</script>"); } }
/// <summary> /// 注册 /// </summary> /// <param name="dicParams"></param> /// <returns></returns> public Dictionary <string, object> Register(Dictionary <string, object> dicParams) { Dictionary <string, object> dicResult = new Dictionary <string, object>(); var dt = JsonHelper.JsonToDataTable(dicParams["user_info"].ToString()); if (dt != null && dt.Rows.Count > 0) { var row = dt.Rows[0]; var dtUser = new Sys.BLL.Account().GetUserInfoByUserLoginId(row["USERLOGINID"].ToString()); if (dtUser != null && dtUser.Rows.Count > 0) { dicResult.Add("response_id", 0); dicResult.Add("response_msg", "手机号重复,不能注册!"); return(dicResult); } var modelUserInfo = new Sys.Model.UserInfo() { UserName = row["USERLOGINID"].ToString(), RealName = row["USERNAME"].ToString(), CompanyName = row["CompanyName"].ToString(), ProvinceId = !string.IsNullOrEmpty(row["ProvinceId"].ToString()) ? Convert.ToInt32(row["ProvinceId"].ToString()) : 0, ProvinceName = row["ProvinceName"].ToString(), CityId = !string.IsNullOrEmpty(row["CityId"].ToString()) ? Convert.ToInt32(row["CityId"].ToString()) : 0, CityName = row["CityName"].ToString(), AreaId = !string.IsNullOrEmpty(row["AreaId"].ToString()) ? Convert.ToInt32(row["AreaId"].ToString()) : 0, AreaName = row["AreaName"].ToString(), Address = row["Address"].ToString(), contact = row["contact"].ToString(), TypeKey = row["TypeKey"].ToString(), TypeValue = row["TypeValue"].ToString(), RoleId = !string.IsNullOrEmpty(row["RoleId"].ToString()) ? Convert.ToInt32(row["RoleId"].ToString()) : 0, }; var result = new Sys.BLL.UserInfo().Add(modelUserInfo, Utils.MD5(row["PASSWORD"].ToString())); if (result > 0) { dicResult.Add("response_id", 1); dicResult.Add("response_msg", "注册成功!"); } else { dicResult.Add("response_id", 0); dicResult.Add("response_msg", "注册失败!"); } } return(dicResult); }
public void PasswordUpdate() { var json = Request["data"]; var rows = (ArrayList)PluSoft.Utils.JSON.Decode(json); foreach (Hashtable row in rows) { var userId = Convert.ToInt32(row["UserId"]); //var password = Utils.MD5(row["Password"].ToString()); var passwordNew = Utils.MD5(row["PasswordNew"].ToString()); var result = new Sys.BLL.Account().AccountUpdate(userId, passwordNew); if (result > 0) { Response.Write("1"); } } Response.Write("0"); }
/// <summary> /// 用户登陆 /// </summary> /// <param name="dicParams"></param> /// <returns></returns> private Dictionary <string, object> GetUserInfo(Dictionary <string, object> dicParams) { Dictionary <string, object> dicResult = new Dictionary <string, object>(); if (!dicParams.ContainsKey("user_id") || !dicParams.ContainsKey("password")) { dicResult.Add("response_id", 0); dicResult.Add("response_msg", "登陆接口缺少参数!"); } else { string userId = dicParams["user_id"].ToString(); string password = Utils.MD5(dicParams["password"].ToString()); var dt = new Sys.BLL.Account().UserLogin(userId, password); if (dt == null || dt.Rows.Count == 0) { // 失败,返回信息 dicResult.Add("response_id", 0); dicResult.Add("response_msg", "登陆失败!"); } else { var state = dt.Rows[0]["State"]; if (state.ToString().Equals("0")) { dicResult.Add("response_id", 0); dicResult.Add("response_msg", "用户未激活!"); } else { dicResult.Add("response_id", 1); dicResult.Add("response_msg", "登陆成功!"); dicResult.Add("user_info", dt); } } } return(dicResult); }
protected void Page_Load(object sender, EventArgs e) { string token = PageRequest.GetQueryString("token"); int orderId = PageRequest.GetQueryInt("orderId", 0); //orderId = 31; var result = new Sys.BLL.Account().CheckToken(token); if (result) { //userLoginId = token.Split('|')[0]; } else { Response.Write("<script>alert('Token验证失败');history.back(-1);</script>"); } orderModel = new Sys.BLL.Orders().GetModel(orderId); orderTypeList = new Sys.BLL.OrderType().GetModelList("OrderId=" + orderId); dtFlow = new Sys.BLL.OrderStatusFlow().GetList(1000, "OrderId=" + orderId, "FlowId desc").Tables[0]; new Sys.BLL.Orders().OrdersStatusInit(out lis); dtComment = new Sys.BLL.OrderComment().GetList("OrderId=" + orderId).Tables[0]; }
/// <summary> /// 登陆 /// </summary> private void UserLogin() { //URL登陆定向,涉及SSO登陆 if (url.Length > 7 && url.Substring(0, 7) == "http://") { url = ""; } else { url = Utils.UrlEncode(url); } //用户名字段判断 if (username == "") { Response.Redirect("login.aspx?url=" + url + "&errmsg=帐户为空,请重新输入!&username="******"") { Response.Redirect("login.aspx?url=" + url + "&errmsg=密码为空,请重新输入!&username="******"") // Response.Redirect("login.aspx?url=" + url + "&errmsg=验证码为空,请重新输入!&username="******"ValidateCode"].Value.ToLower()) // Response.Redirect("login.aspx?url=" + url + "&errmsg=验证码不正确,请重新输入!&username="******"WebConfig", "AdminIpBlockType", 0); switch (AdminIpBlockType) { case 0: break; case 1: { var bllIpBlock = new Sys.BLL.SysIpBlock(); if (bllIpBlock.Exists(0, 1, Utils.GetRealIP())) { Response.Redirect("login.aspx?url=" + url + "&errmsg=当前IP被限制登录系统后台!&username="******"login.aspx?url=" + url + "&errmsg=当前IP被限制登录系统后台!&username="******"login.aspx?url=" + url + "&errmsg=帐户不存在!&username="******"login.aspx?url=" + url + "&errmsg=密码不正确!&username="******"login.aspx?url=" + url + "&errmsg=该账户无权登陆系统!&username="******"login.aspx?url=" + url + "&errmsg=该账户禁止登陆系统!&username="******"login.aspx?url=" + url + "&errmsg=该账户无权登陆系统后台!&username="******"login.aspx?url=" + url + "&errmsg=该账户禁止登陆系统后台!&username="******"managelogin", "登陆成功"); //Cookie保存-帐户 Sys.BLL.Admin.SetUsername(modelAdmin.Username); //Cookie保存-姓名 Sys.BLL.Admin.SetRealName(modelAdmin.RealName); //Cookie保存-rememberme if (PageRequest.GetInt("rememberme", 0) == 1) { Utils.WriteCookie("manage_LoginName", Utils.UrlEncode(username), 518400, ConfigHelper.GetConfigString("CookieDomain")); } if (modelAdmin.Username == modelAdmin.RealName) { Response.Redirect("main.aspx?url=" + Utils.UrlEncode("user/profile.aspx")); } else if (url != "") { Response.Redirect("main.aspx?url=" + Utils.UrlEncode(url)); } else { Response.Redirect("main.aspx"); } }