/// 注册 /// </summary> public void regist(HttpContext context) { string outmsg = "{\"status\":1,\"msg\":\"注册成功!\"}"; string mobile = _Request.GetString("mobile"); string usersname = _Request.GetString("usersname"); string password = _Request.GetString("password"); string usersaera = _Request.GetString("usersaera"); string usernick = _Request.GetString("usernick");//y用户昵称 string userPwd1 = Vincent._MD5Encrypt.GetMD5(password.Trim()); Model.users model = new Model.users(); BLL.users bll = new BLL.users(); model.user_name = mobile; model.mobile = mobile; model.isEmail = 0; model.isMobile = 0; model.Parentid = 0; model.Leftor_right = 0; model.MarketId = 0; model.OrganizeId = 0; model.PreId = 0; model.nick_name = usernick;//用户昵称 //model.password = Vincent._DESEncrypt.Encrypt(password.Trim()); //model.password = Vincent._DESEncrypt.Encrypt(password.Trim()); model.salt = Vincent._DTcms.Utils.GetCheckCode(6); //获得6位的salt加密字符串 model.password = _DESEncrypt.Encrypt(password, model.salt); if (!bll.ExistsMobile(mobile)) { int id = bll.AddPc(model); if (id > 0) { DataTable dt = bll.GetList(0, "id =" + id + " ", "id asc").Tables[0]; if (dt != null && dt.Rows.Count > 0) { outmsg = CreateJsonParameters(dt); } //// 保存session值 context.Session[DTKeys.SESSION_USER_INFO] = model; context.Session.Timeout = 45; context.Response.Clear(); context.Response.Write(outmsg); context.Response.End(); } else { context.Response.Clear(); context.Response.Write("{\"status\":0,\"msg\":\"注册未成功!\"}"); context.Response.End(); } } else { context.Response.Clear(); context.Response.Write("{\"status\":0,\"msg\":\"注册未成功!\"}"); context.Response.End(); } }