Exemple #1
0
        /// <summary>
        /// 获取用户的数据库存储的密码,密文
        /// 这里如果用户的密码不录入,则认为是默认密码
        /// </summary>
        /// <param name="secretKey">加密的密钥</param>
        /// <param name="password">密码明文</param>
        /// <returns>加密后的密码密文</returns>
        public string GetDbPassword(string secretKey, string password = null)
        {
            if (password == null)
            {
                password = Configs.GetSetting("defaultPassword");
                password = MD5Encrypt.GetMD5_32(password);
            }
            string dbPassword =
                MD5Encrypt.GetMD5_32(DESEncrypt.Encrypt(password.ToLower(), secretKey).ToLower()).ToLower();

            return(dbPassword);
        }
Exemple #2
0
        /// <summary>
        /// 添加操作者的缓存信息
        /// </summary>
        /// <param name="operatorModel">操作人员</param>
        public void AddCurrent(OperatorModel operatorModel)
        {
            if (LoginProvider == "Cookie")
            {
                WebHelper.WriteCookie(LoginUserKey, DESEncrypt.Encrypt(operatorModel.ToJson()), 60);
            }
            else
            {
                WebHelper.WriteSession(LoginUserKey, DESEncrypt.Encrypt(operatorModel.ToJson()));
            }

            WebHelper.WriteCookie("LT_mac", MD5Encrypt.GetMD5_32(SystemHelper.GetMacByNetworkInterface().ToJson()));
        }