wzp
2022-10-25 1961452ebc018cf758924f26d9c7aa0b31495227
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,11 +141,12 @@
                            + "<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;
                        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;";
@@ -157,9 +158,9 @@
                        str += @"白名单";
                        str += @"</a>&nbsp;";
                        str += string.Format(@"<a class=""action-modal-black btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
                        str += @"黑名单";
                        str += @"</a>&nbsp;";
                        //str += string.Format(@"<a class=""action-modal-black btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
                        //str += @"黑名单";
                        //str += @"</a>&nbsp;";
                        //str += string.Format(@"<a class=""action-modal-resetPwd btn btn-xs btn-primary"" href=""javascript:;"" data-id=""{0}"">", item.ClientID);
                        //str += @"重置密码";
@@ -323,8 +324,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 +407,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");
@@ -416,8 +419,8 @@
        string financialStaff = context.GetString("financialStaff");
        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");
@@ -527,8 +530,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.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 +542,7 @@
        client.IsLoginIpAllowGather = isLoginIpAllowGather;
        client.IsLoginCityRestrict = string.IsNullOrEmpty(isLoginCityRestrict) ? 0 : int.Parse(isLoginCityRestrict);
        client.IsLoginCityAllowGather = isLoginCityAllowGather;
        client.PermissionData = permissionData;
        _Dao.Update(client);
@@ -564,8 +567,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");
@@ -591,6 +594,11 @@
        if (string.IsNullOrEmpty(clientID))
        {
            throw new ArgumentException("客户账号不能为空,且必须为公司名称!");
        }
        if (string.IsNullOrEmpty(company))
        {
            throw new AggregateException("公司名称不能为空,且必须是全称");
        }
        if (string.IsNullOrEmpty(password) || !System.Text.RegularExpressions.Regex.IsMatch(password, @"[a-zA-Z0-9]{4,10}"))
@@ -691,12 +699,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;
@@ -704,7 +715,7 @@
        client.Telephone = telephone;
        client.Agent = agent;
        client.PermissionData = permissionData;
        client.ParentId = context.OperatorID;
        client.Client_Parentid = context.OperatorID;
        client.Certification_Status = 1;
        client.Company = company;
        client.CustomerManager = customerManager;
@@ -713,8 +724,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);