Beispiel #1
0
        public ActionResult EditDraw(MD_DrawAccount model, int uid = -1)
        {
            UserInfo userInfo = AdminUsers.GetUserById(uid);

            if (userInfo == null)
            {
                return(PromptView("用户不存在"));
            }

            if (ModelState.IsValid)
            {
                model.Drawpwd = Users.CreateUserPassword(model.Drawpwd, userInfo.Salt);
                model.Account = userInfo.Mobile;
                bool result = false;

                result = Recharge.UpdateDrawPWD(model);
                if (result)
                {
                    return(PromptView("提现密码修改成功"));
                }
                else
                {
                    return(PromptView("提现密码修改失败"));
                }
            }
            Load(0);

            return(View(model));
        }
Beispiel #2
0
        /// <summary>
        /// 设置提现密码
        /// </summary>
        /// <returns></returns>
        public ActionResult DrawPwd()
        {
            try
            {
                NameValueCollection parmas = WorkContext.postparms;

                MD_DrawAccount draw = new MD_DrawAccount
                {
                    Uid     = WorkContext.Uid,
                    Drawpwd = parmas["password"]
                };

                PartUserInfo partUserInfo = Users.GetPartUserById(WorkContext.Uid);

                //draw.Drawpwd = Users.CreateUserPassword(draw.Drawpwd, partUserInfo.Salt);
                if (parmas.AllKeys.Contains("oldpwd") && parmas["oldpwd"] != "")
                {
                    //string oldpwd = Users.CreateUserPassword(parmas["oldpwd"], partUserInfo.Salt);
                    string oldpwd = parmas["oldpwd"];
                    bool   pwdres = Recharge.ValidateDrawPwdByUid(WorkContext.Uid, oldpwd);
                    if (!pwdres)
                    {
                        return(APIResult("error", "原有密码错误"));
                    }
                }
                if (partUserInfo.Password == draw.Drawpwd)
                {
                    return(APIResult("error", "提现密码和登录密码不能一致"));
                }

                bool saveres = Recharge.UpdateDrawPWD(draw);
                if (saveres)
                {
                    return(APIResult("success", "保存成功"));
                }
                else
                {
                    return(APIResult("error", "保存失败"));
                }
            }
            catch (Exception ex)
            {
                return(APIResult("error", "保存失败"));
            }
        }