From f63d8ead25bdb3c32dacca817a059bd30390e9bc Mon Sep 17 00:00:00 2001
From: yzh <snbbt@21cn.com>
Date: 星期三, 15 六月 2022 22:20:07 +0800
Subject: [PATCH] 1.系统账户数据库优化:   修改“账户类型”的数据类型为VARCHAR2(1024),多个角色时以半角“,”分隔。   加密盐。 密码加密优化;账户登录优化;角色权限管理(作废用户权限); 2.字典类型管理(定义:用户角色) 3.字典数据管理(初始化用户角色数据) 3.角色权限管理 4.系统账户管理,账户类型对应用户角色(可多选)。

---
 web/web/GwClient.ashx |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/web/web/GwClient.ashx b/web/web/GwClient.ashx
index 47443d7..ccb85a6 100644
--- a/web/web/GwClient.ashx
+++ b/web/web/GwClient.ashx
@@ -22,7 +22,7 @@
     private List<SysUser> _SysUserList;
 
     private int _userId = -1;
-    private int _userType = -1;
+    private string _userType = "";
     private string _account = "";
     private string initPwd = ConfigurationManager.AppSettings["initPwd"];
 
@@ -141,7 +141,7 @@
                             + "<td>"+ (item.Is_Enable == 1 ? "<span class='label label-primary'>鍚敤</span>" : "<span class='label label-default'>鍋滅敤</span>") + "</td>";
 
                     str += @"<td>";
-                        
+
                     if (item.Is_Enable == 1)
                     {
                         //string loginStr = "http://" + serverIp + ":" + clientPort + "/Attachedlogin.aspx?action=Attachedlogin&account=" + item.Account + "&password=" + item.Password;
@@ -323,8 +323,10 @@
         {
             throw new ArgumentException("鐧诲綍瀵嗙爜涓嶈兘涓虹┖锛屼笖蹇呴』涓�4-10浣嶈嫳鏂囨垨鏁板瓧瀛楃缁勫悎锛�");
         }
+        GwClient gwClient = _Dao.Get(clientID);
 
         //瀵嗙爜MD5鍔犲瘑锛�
+        newPwd += gwClient.Salt;
         newPwd = DataHelper.MD5Hex(newPwd);
 
         _Dao.UpdatePassword(clientID, newPwd);
@@ -404,7 +406,7 @@
         int id = Int32.Parse(context.GetString("id"));
         string clientID = context.GetString("clientID");
         string company = context.GetString("company");
-        string password = context.GetString("password");
+        //string password = context.GetString("password");
         string clientName = context.GetString("clientName");
         string address = context.GetString("address");
         string telephone = context.GetString("telephone");
@@ -417,7 +419,7 @@
         string chargeType = context.GetString("chargeType");
         string smsStatusReport = context.GetString("smsStatusReport");
         string mmsStatusReport = context.GetString("mmsStatusReport");
-            
+
         string isEnableWhite = context.GetString("isEnableWhite");
         string isEnableBlack = context.GetString("isEnableBlack");
         string isRemoteLoginNotice = context.GetString("isRemoteLoginNotice");
@@ -528,7 +530,7 @@
         client.ChargeType = string.IsNullOrEmpty(chargeType) ? 0 : int.Parse(chargeType);
         client.SmsStatusReport = string.IsNullOrEmpty(smsStatusReport) ? 0 : int.Parse(smsStatusReport);
         client.MmsStatusReport = string.IsNullOrEmpty(mmsStatusReport) ? 0 : int.Parse(mmsStatusReport);
-            
+
         client.IsEnableWhite = string.IsNullOrEmpty(isEnableWhite) ? 0 : int.Parse(isEnableWhite);
         client.IsEnableBlack = string.IsNullOrEmpty(isEnableBlack) ? 0 : int.Parse(isEnableBlack);
         client.IsRemoteLoginNotice = string.IsNullOrEmpty(isRemoteLoginNotice) ? 0 : int.Parse(isRemoteLoginNotice);
@@ -539,7 +541,7 @@
         client.IsLoginIpAllowGather = isLoginIpAllowGather;
         client.IsLoginCityRestrict = string.IsNullOrEmpty(isLoginCityRestrict) ? 0 : int.Parse(isLoginCityRestrict);
         client.IsLoginCityAllowGather = isLoginCityAllowGather;
-                        
+
         client.PermissionData = permissionData;
 
         _Dao.Update(client);
@@ -564,8 +566,8 @@
         string financialStaff = context.GetString("financialStaff");
         string chargeType = context.GetString("chargeType");
         string smsStatusReport = context.GetString("smsStatusReport");
-        string mmsStatusReport = context.GetString("mmsStatusReport");            
-            
+        string mmsStatusReport = context.GetString("mmsStatusReport");
+
         string isEnableWhite = context.GetString("isEnableWhite");
         string isEnableBlack = context.GetString("isEnableBlack");
         string isRemoteLoginNotice = context.GetString("isRemoteLoginNotice");
@@ -691,12 +693,15 @@
             }
         }
 
+        string salt = DataConverter.getRandom(6);
+        password += salt;
         //瀵嗙爜鍔犲瘑
         password = DataHelper.MD5Hex(password);
 
         var client = new Model.GwClient();
         client.ClientID = clientID;
         client.Password = password;
+        client.Salt = salt;
 
         client.ClientName = clientName;
         client.Address = address;
@@ -713,8 +718,8 @@
         client.FinancialStaff = financialStaff;
         client.ChargeType = string.IsNullOrEmpty(chargeType) ? 0 : int.Parse(chargeType);
         client.SmsStatusReport = string.IsNullOrEmpty(smsStatusReport) ? 0 : int.Parse(smsStatusReport);
-        client.MmsStatusReport = string.IsNullOrEmpty(mmsStatusReport) ? 0 : int.Parse(mmsStatusReport);            
-            
+        client.MmsStatusReport = string.IsNullOrEmpty(mmsStatusReport) ? 0 : int.Parse(mmsStatusReport);
+
         client.IsEnableWhite = string.IsNullOrEmpty(isEnableWhite) ? 0 : int.Parse(isEnableWhite);
         client.IsEnableBlack = string.IsNullOrEmpty(isEnableBlack) ? 0 : int.Parse(isEnableBlack);
         client.IsRemoteLoginNotice = string.IsNullOrEmpty(isRemoteLoginNotice) ? 0 : int.Parse(isRemoteLoginNotice);

--
Gitblit v1.9.1