Exemplo n.º 1
0
    private string modifyPsw()
    {
        UserInfo user   = (UserInfo)Session["user"];
        string   oldPsw = Request.Form["oldPsw"];
        string   newPsw = Request.Form["newPsw"];

        user.passWord = oldPsw;
        string token = "";
        string res   = UserInfoManage.Login(ref user, ref token);//"登录成功"

        if (res == "登录成功")
        {
            user.passWord = newPsw;
            res           = UserInfoManage.ModifyPassword(ref user);
            //Session["user"] = user;
            if (res.Contains("操作成功"))
            {
                Session["user"] = user;
                List <DepartmentPost> dpList = UserInfoManage.GetDepartmentPostList(user);
                Session["DepartmentPostList"] = dpList;
                res = "密码修改成功!";
            }
        }
        return(res);
    }