bug
lu
7 天以前 98e93a53c3407b9785eba27faec13fe7afc1255b
DevApp/Gs.DevApp/DevFrm/FrmLogin.cs
@@ -1,6 +1,5 @@
using AutoUpdaterDotNET;
using DevExpress.XtraEditors;
using DevExpress.XtraRichEdit.Export.Rtf;
using Gs.DevApp.Entity;
using Gs.DevApp.Properties;
using Gs.DevApp.ToolBox;
@@ -35,7 +34,7 @@
            _getRemember();
            btnLogin.Click += BtnLogin_Click;
            btnCancel.Click += BtnCancel_Click;
            lbVersion.Text = _productName+ ",版本(" + _version + ")" + ",使用字体(" + _strFont + ")"+",服务地址("+ _webApiUrl + ")";
            lbVersion.Text = _productName + ",版本(" + _version + ")" + ",使用字体(" + _strFont + ")" + ",服务地址(" + _webApiUrl + ")";
        }
        private void BtnCancel_Click(object sender, EventArgs e)
@@ -51,7 +50,6 @@
                txtUser.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtPwd.Text.Trim()))
            {
                MsgHelper.Warning("密码不能为空!");
@@ -76,6 +74,7 @@
                    Settings.Default.userName = ckRemember.Checked ? txtUser.Text.Trim() : "";
                    Settings.Default.userPwd = ckRemember.Checked ? txtPwd.Text.Trim() : "";
                    Settings.Default.remember = ckRemember.Checked;
                    Settings.Default.isWeight = ckWeight.Checked;
                    Settings.Default.Save();
                    LoginInfoModel.CurrentUser.LoginUserGuid = _login["loginGuid"].ToString();
                    LoginInfoModel.CurrentUser.LoginTime = DateTime.Now.ToString("yyyy-MM-dd hh:mm");
@@ -90,7 +89,7 @@
            catch (Exception ex)
            {
                DialogResult = DialogResult.Cancel;
                MsgHelper.Warning("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
@@ -101,17 +100,16 @@
        {
            try
            {
                if (Settings.Default.remember)
                {
                    txtUser.Text = Settings.Default.userName;
                    txtPwd.Text = Settings.Default.userPwd;
                    ckRemember.Checked = true;
                }
                txtUser.Text = Settings.Default.userName;
                txtPwd.Text = Settings.Default.userPwd;
                ckRemember.Checked = Settings.Default.remember;
                ckWeight.Checked = Settings.Default.isWeight;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 读取字体
@@ -133,12 +131,14 @@
                DevExpress.XtraEditors.WindowsFormsSettings.DefaultMenuFont = new System.Drawing.Font(ary[0], _ft);
                DevExpress.XtraEditors.WindowsFormsSettings.DefaultPrintFont = new System.Drawing.Font(ary[0], _ft);
                #endregion
            }
            catch (Exception)
            catch (Exception ex)
            {
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        #region 自动更新
        private void _autoUpdate()
        {
            _version = ConfigurationManager.AppSettings["Version"];
@@ -146,7 +146,6 @@
            AutoUpdater.Start(ConfigurationManager.AppSettings["AutoUpdaterXml"]);
            AutoUpdater.CheckForUpdateEvent += AutoUpdater_CheckForUpdateEvent;
        }
        private void AutoUpdater_CheckForUpdateEvent(UpdateInfoEventArgs args)
        {
            if (args == null || string.IsNullOrEmpty(args.DownloadURL))
@@ -156,12 +155,10 @@
                Application.Exit();
                return;
            }
            if (!args.IsUpdateAvailable)
            {
                return;
            }
            var _strMsg =
                string.Format(
                    $@"有新版本 {args.CurrentVersion} 可用,您使用的是 {args.InstalledVersion}版本,这是必需的更新,按“是(Y)”开始更新应用程序。");
@@ -171,7 +168,6 @@
                Application.Exit();
                return;
            }
            try
            {
                if (AutoUpdater.DownloadUpdate(args))
@@ -193,7 +189,6 @@
                        config.Save(ConfigurationSaveMode.Modified);
                        ConfigurationManager.RefreshSection("appSettings");
                    }
                    Application.Exit();
                }
                else
@@ -211,6 +206,13 @@
            }
        }
        #endregion
        /// <summary>
        /// 读取mac
        /// </summary>
        /// <returns></returns>
        private string GetMacAddress()
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();