コード例 #1
0
        /// <summary>
        /// 得到当前登录用户信息
        /// </summary>
        /// <returns></returns>
        public SysUser GetCurrentUser()
        {
            SysUserDal sysUserDal = lessContext.GetService <SysUserDal>();
            string     loginName  = lessContext.Jwt.Result[BasicConst.JWT_USER].loginName.ToString();
            SysUser    sysUser    = sysUserDal.GetUser(loginName);

            return(sysUser);
        }
コード例 #2
0
    protected void lbtnSave_Click(object sender, EventArgs e)
    {
        DataTable userTable = userDal.GetUser(txtUserName.Text.Trim());

        if (userTable.Rows[0]["UserPassword"].ToString() == THOK.Util.Coding.Encoding(txtOldPwd.Text))
        {
            if (userDal.ChangePassword(txtUserName.Text.Trim(), THOK.Util.Coding.Encoding(txtAckPwd.Text)))
            {
                Response.Redirect("ModifyPwdSuccess.aspx");
            }
            else
            {
                Response.Write("<script>alert(\"密码修改失败!\")</script>");
            }
        }
        else
        {
            JScript.Instance.ShowMessage(this, "原密码错误!");
        }
    }