/// <summary>
        /// 获取重置密码邮件内容
        /// </summary>
        /// <param name="user">用户</param>
        /// <returns></returns>
        private string GetForgetPwdSendContent(Sys_User user)
        {
            StringBuilder sb        = new StringBuilder();
            string        webServer = WebConfigHelper.GetAppSettingValue("WebServer"); //跳转服务器
            string        webIndex  = WebConfigHelper.GetAppSettingValue("WebIndex");  //跳转首页地址
            string        webName   = WebConfigHelper.GetCurrWebName();

            sb.Append("<div style=\"font-size: 13px;padding:40px;background-color: #F7F7F7;font-family:Arial, Helvetica, sans-serif; color:#333;\">");
            sb.Append("<div class=\"mailcontentbox\" style=\"min-width: 500px;max-width: 750px;\">");
            sb.Append("<div style=\"background-color: gray;\">");
            sb.AppendFormat("<a href=\"{0}{1}\" target=\"_blank\">", webServer, webIndex);
            string logoPath = WebConfigHelper.GetCurrWebLogo();

            if (!string.IsNullOrEmpty(logoPath))
            {
                logoPath = logoPath.Substring(1, logoPath.Length - 1);
                logoPath = webServer + logoPath;
            }
            sb.AppendFormat("<img style=\"margin:5px 0px 5px 10px;\" src=\"{0}\" border=\"0\">", logoPath);
            sb.Append("</a>");
            sb.Append("</div>");
            sb.Append("<div style=\"border-width:0px 1px 2px 1px;border-style:solid;border-color:#D7D7D7;border-bottom-color:#333;padding:20px;background:#fff;\">");
            sb.Append("<p style=\"line-height:20px;padding-bottom:5px;\">");
            sb.AppendFormat("	您好 {0},", string.IsNullOrEmpty(user.AliasName) ? user.UserName : user.AliasName);
            sb.Append("</p>");
            sb.Append("<p style=\"line-height:20px;padding-bottom:5px;\">");
            sb.AppendFormat("您发送了重置{0}密码的申请。			</p>", webName);
            sb.Append("<p style=\"line-height:20px;padding-bottom:5px;\">");
            sb.Append("请点击下边的链接进行确认,之后您将可以设置一个新密码。			</p>");
            sb.Append("<p style=\"line-height:20px;padding-bottom:5px;\">");
            string resetPwdUrl = string.Format("{0}User/ResetPwd.html?uid={1}", webServer, user.Id);

            sb.AppendFormat("	<a href=\"{0}\" target=\"_blank\" style=\"color:#36C;\">{0}</a>", resetPwdUrl);
            sb.Append("</p>");
            sb.Append("<p style=\"line-height:13px; margin: 40px 0px 10px\">");
            sb.AppendFormat("感谢您使用{0}			</p>", webName);
            sb.Append("<p style=\"padding-bottom:5px; padding-top:0px; margin-top:0px\">");
            sb.AppendFormat("	{0} Team", webName);
            sb.Append("</p>");
            sb.Append("</div>");
            sb.Append("<div style=\"color:#777;padding: 15px;\">");
            sb.AppendFormat("	©{0} {1} Team.", DateTime.Now.Year, webName);
            sb.Append("</div>");
            sb.Append("</div>");
            sb.Append("</div>");
            return(sb.ToString());
        }
        public JsonResult UserForgetPwd(string username)
        {
            string userTipDes = "用户名";

            if (GlobalSet.EmpUserNameConfigRule == UserNameAndEmpConfigRule.Email)
            {
                userTipDes = "邮箱";
            }
            else if (GlobalSet.EmpUserNameConfigRule == UserNameAndEmpConfigRule.Mobile)
            {
                userTipDes = "手机号";
            }
            if (string.IsNullOrEmpty(username))
            {
                return(Json(new ReturnResult()
                {
                    Success = false, Message = string.Format("{0}不能为空!", userTipDes)
                }));
            }
            if (GlobalSet.EmpUserNameConfigRule == UserNameAndEmpConfigRule.Email && !Validator.IsEmail(username))
            {
                return(Json(new ReturnResult()
                {
                    Success = false, Message = "请输入正确的邮箱地址!"
                }));
            }
            if (GlobalSet.EmpUserNameConfigRule == UserNameAndEmpConfigRule.Mobile && !Validator.IsMobilePhoneNumber(username))
            {
                return(Json(new ReturnResult()
                {
                    Success = false, Message = "请输入正确的手机号码!"
                }));
            }
            string errMsg = string.Empty;
            bool   rs     = UserOperate.UserIsValid(username, out errMsg);

            if (!rs)
            {
                return(Json(new ReturnResult()
                {
                    Success = false, Message = errMsg
                }));
            }
            string email = username;

            if (GlobalSet.EmpUserNameConfigRule != UserNameAndEmpConfigRule.Email)
            {
                OrgM_Emp emp = OrgMOperate.GetEmpByUserName(username);
                if (emp != null)
                {
                    email = OrgMOperate.GetEmployeeEmails(new List <Guid>()
                    {
                        emp.Id
                    }).Keys.FirstOrDefault();
                }
            }
            if (!email.Contains("@"))
            {
                return(Json(new ReturnResult()
                {
                    Success = false, Message = "获取用户邮箱失败!"
                }));
            }
            Dictionary <string, string> dicMail = new Dictionary <string, string>();

            dicMail.Add(email, email);
            string   subject = string.Format("重置您在{0}的密码", WebConfigHelper.GetCurrWebName());
            Sys_User user    = UserOperate.GetUser(username);
            string   content = GetForgetPwdSendContent(user);

            errMsg = SystemOperate.EmailSend(subject, content, dicMail, null, null, null, true);
            return(Json(new ReturnResult()
            {
                Success = string.IsNullOrEmpty(errMsg), Message = errMsg
            }));
        }