wzp
2022-07-12 705909e14fe4e9f2fc261ee4eb40a8b41fa2f6d4
增加免密登陆的token
24个文件已修改
93 ■■■■ 已修改文件
web/.vs/Web/config/applicationhost.config 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/.vs/Web/v16/.suo 补丁 | 查看 | 原始文档 | blame | 历史
web/App_Code/bin/Debug/App_Code.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/App_Code/bin/Debug/App_Code.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Common/DESEncrypt.cs 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Common.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Common.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/UMCLib/bin/Debug/UMCLib.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/UMCLib/bin/Debug/UMCLib.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/App_Code.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/App_Code.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Common.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Common.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/UMCLib.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/UMCLib.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwClient.ashx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/.vs/Web/config/applicationhost.config
@@ -162,7 +162,7 @@
            </site>
            <site name="web" id="2">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\web" />
                    <virtualDirectory path="/" physicalPath="C:\Users\mac\Desktop\Work-Archives\SMGW\SMGW_NewWeb\web\web" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:60960:localhost" />
web/.vs/Web/v16/.suo
Binary files differ
web/App_Code/bin/Debug/App_Code.dll
Binary files differ
web/App_Code/bin/Debug/App_Code.pdb
Binary files differ
web/Common/DESEncrypt.cs
@@ -7,57 +7,57 @@
namespace Common
{
  public class DESEncrypt
  {
    public class DESEncrypt
    {
        //加密串
        //public static string encryptStr = "litianping";
        public static string encryptStr = "abcDEF123@$@";
        public static string Encrypt(string Text)
    {
      return DESEncrypt.Encrypt(Text, encryptStr );
    }
    public static string Encrypt(string Text, string sKey)
    {
      DESCryptoServiceProvider cryptoServiceProvider = new DESCryptoServiceProvider();
      byte[] bytes = Encoding.Default.GetBytes(Text);
            //c#的DES加密是key为8位
            cryptoServiceProvider.Key = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
      cryptoServiceProvider.IV = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
      MemoryStream memoryStream = new MemoryStream();
      CryptoStream cryptoStream = new CryptoStream((Stream) memoryStream, cryptoServiceProvider.CreateEncryptor(), CryptoStreamMode.Write);
      cryptoStream.Write(bytes, 0, bytes.Length);
      cryptoStream.FlushFinalBlock();
      StringBuilder stringBuilder = new StringBuilder();
      foreach (byte num in memoryStream.ToArray())
        stringBuilder.AppendFormat("{0:X2}", (object) num);
      return stringBuilder.ToString();
    }
    public static string Decrypt(string Text)
    {
      return DESEncrypt.Decrypt(Text, encryptStr);
    }
    public static string Decrypt(string Text, string sKey)
    {
      DESCryptoServiceProvider cryptoServiceProvider = new DESCryptoServiceProvider();
      int length = Text.Length / 2;
      byte[] buffer = new byte[length];
      for (int index = 0; index < length; ++index)
      {
        int num = Convert.ToInt32(Text.Substring(index * 2, 2), 16);
        buffer[index] = (byte) num;
        {
            return DESEncrypt.Encrypt(Text, encryptStr);
        }
        public static string Encrypt(string Text, string sKey)
        {
            DESCryptoServiceProvider cryptoServiceProvider = new DESCryptoServiceProvider();
            byte[] bytes = Encoding.Default.GetBytes(Text);
            //c#的DES加密是key为8位
            cryptoServiceProvider.Key = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
        cryptoServiceProvider.IV = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
        MemoryStream memoryStream = new MemoryStream();
      CryptoStream cryptoStream = new CryptoStream((Stream) memoryStream, cryptoServiceProvider.CreateDecryptor(), CryptoStreamMode.Write);
      cryptoStream.Write(buffer, 0, buffer.Length);
      cryptoStream.FlushFinalBlock();
      return Encoding.Default.GetString(memoryStream.ToArray());
            cryptoServiceProvider.IV = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            MemoryStream memoryStream = new MemoryStream();
            CryptoStream cryptoStream = new CryptoStream((Stream)memoryStream, cryptoServiceProvider.CreateEncryptor(), CryptoStreamMode.Write);
            cryptoStream.Write(bytes, 0, bytes.Length);
            cryptoStream.FlushFinalBlock();
            StringBuilder stringBuilder = new StringBuilder();
            foreach (byte num in memoryStream.ToArray())
                stringBuilder.AppendFormat("{0:X2}", (object)num);
            return stringBuilder.ToString();
        }
        public static string Decrypt(string Text)
        {
            return DESEncrypt.Decrypt(Text, encryptStr);
        }
        public static string Decrypt(string Text, string sKey)
        {
            DESCryptoServiceProvider cryptoServiceProvider = new DESCryptoServiceProvider();
            int length = Text.Length / 2;
            byte[] buffer = new byte[length];
            for (int index = 0; index < length; ++index)
            {
                int num = Convert.ToInt32(Text.Substring(index * 2, 2), 16);
                buffer[index] = (byte)num;
            }
            //c#的DES加密是key为8位
            cryptoServiceProvider.Key = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            cryptoServiceProvider.IV = Encoding.ASCII.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            MemoryStream memoryStream = new MemoryStream();
            CryptoStream cryptoStream = new CryptoStream((Stream)memoryStream, cryptoServiceProvider.CreateDecryptor(), CryptoStreamMode.Write);
            cryptoStream.Write(buffer, 0, buffer.Length);
            cryptoStream.FlushFinalBlock();
            return Encoding.Default.GetString(memoryStream.ToArray());
        }
    }
  }
}
web/Lib/Common.dll
Binary files differ
web/Lib/Common.pdb
Binary files differ
web/Lib/Dao.dll
Binary files differ
web/Lib/Dao.pdb
Binary files differ
web/Lib/Model.dll
Binary files differ
web/Lib/Model.pdb
Binary files differ
web/UMCLib/bin/Debug/UMCLib.dll
Binary files differ
web/UMCLib/bin/Debug/UMCLib.pdb
Binary files differ
web/web/Bin/App_Code.dll
Binary files differ
web/web/Bin/App_Code.pdb
Binary files differ
web/web/Bin/Common.dll
Binary files differ
web/web/Bin/Common.pdb
Binary files differ
web/web/Bin/Dao.dll
Binary files differ
web/web/Bin/Dao.pdb
Binary files differ
web/web/Bin/Model.dll
Binary files differ
web/web/Bin/Model.pdb
Binary files differ
web/web/Bin/UMCLib.dll
Binary files differ
web/web/Bin/UMCLib.pdb
Binary files differ
web/web/GwClient.ashx
@@ -145,7 +145,8 @@
                    if (item.Is_Enable == 1)
                    {
                        //string loginStr = "http://" + serverIp + ":" + clientPort + "/Attachedlogin.aspx?action=Attachedlogin&account=" + item.Account + "&password=" + item.Password;
                        string loginStr = "http://" + serverIp + ":" + clientPort + "/Attachedlogin.aspx?action=Attachedlogin&account=" + item.Account ;
                        string token = DESEncrypt.Encrypt(item.Password);//对称加密
                        string loginStr = "http://" + serverIp + ":" + clientPort + "/Attachedlogin.aspx?action=Attachedlogin&account=" + item.Account+"&token="+token ;
                        str += string.Format("<a class=\"action-modal-login btn btn-success btn-xs \" href=\"javascript:;\" data-url=\"{0}\" data-id=\"{1}\" target=\"_blank\">", (object)loginStr, (object)item.ClientID);
                        str += "&nbsp;登录</a>&nbsp;";