From bac46e3c57dbccb2daa9f3b796386ca9d65608fb Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期一, 20 一月 2025 11:27:24 +0800 Subject: [PATCH] 更改用户登录 --- DevApp/Gs.DevApp/DevFrm/FrmMain.cs | 1 DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs | 1 DevApp/Gs.DevApp/DevFrm/FrmLogin.cs | 61 +-------------- DevApp/Gs.DevApp/Entity/LoginInfoModel.cs | 9 -- DevApp/Gs.DevApp/DevFrm/FrmLogin.Designer.cs | 46 +--------- DevApp/Gs.DevApp/Properties/Settings.Designer.cs | 21 +---- DevApp/Gs.DevApp/App.config | 15 --- DevApp/Gs.DevApp/Properties/Settings.settings | 44 ++++------ 8 files changed, 36 insertions(+), 162 deletions(-) diff --git a/DevApp/Gs.DevApp/App.config b/DevApp/Gs.DevApp/App.config index 48985a7..dfcd2d5 100644 --- a/DevApp/Gs.DevApp/App.config +++ b/DevApp/Gs.DevApp/App.config @@ -48,9 +48,6 @@ <setting name="remember" serializeAs="String"> <value>False</value> </setting> - <setting name="orgGuid" serializeAs="String"> - <value /> - </setting> <setting name="fontSize" serializeAs="String"> <value>10</value> </setting> @@ -77,16 +74,4 @@ <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.23.1, Culture=neutral, PublicKeyToken=89b483f429c47342" /> </DbProviderFactories> </system.data> - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" /> - </dependentAssembly> - </assemblyBinding> - </runtime> </configuration> \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/FrmLogin.Designer.cs b/DevApp/Gs.DevApp/DevFrm/FrmLogin.Designer.cs index 198ea29..c1a5e8d 100644 --- a/DevApp/Gs.DevApp/DevFrm/FrmLogin.Designer.cs +++ b/DevApp/Gs.DevApp/DevFrm/FrmLogin.Designer.cs @@ -32,12 +32,10 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmLogin)); this.lbVersion = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); - this.comOrg = new System.Windows.Forms.ComboBox(); this.txtUser = new DevExpress.XtraEditors.TextEdit(); this.ckRemember = new DevExpress.XtraEditors.CheckEdit(); this.txtPwd = new DevExpress.XtraEditors.TextEdit(); this.btnCancel = new DevExpress.XtraEditors.SimpleButton(); - this.labelControl3 = new DevExpress.XtraEditors.LabelControl(); this.btnLogin = new DevExpress.XtraEditors.SimpleButton(); this.labelControl2 = new DevExpress.XtraEditors.LabelControl(); this.labelControl1 = new DevExpress.XtraEditors.LabelControl(); @@ -62,12 +60,10 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.Transparent; - this.panel1.Controls.Add(this.comOrg); this.panel1.Controls.Add(this.txtUser); this.panel1.Controls.Add(this.ckRemember); this.panel1.Controls.Add(this.txtPwd); this.panel1.Controls.Add(this.btnCancel); - this.panel1.Controls.Add(this.labelControl3); this.panel1.Controls.Add(this.btnLogin); this.panel1.Controls.Add(this.labelControl2); this.panel1.Controls.Add(this.labelControl1); @@ -78,20 +74,10 @@ this.panel1.Size = new System.Drawing.Size(408, 276); this.panel1.TabIndex = 243; // - // comOrg - // - this.comOrg.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comOrg.Font = new System.Drawing.Font("Tahoma", 10F); - this.comOrg.FormattingEnabled = true; - this.comOrg.Location = new System.Drawing.Point(168, 97); - this.comOrg.Name = "comOrg"; - this.comOrg.Size = new System.Drawing.Size(211, 29); - this.comOrg.TabIndex = 245; - // // txtUser // this.txtUser.EditValue = ""; - this.txtUser.Location = new System.Drawing.Point(168, 9); + this.txtUser.Location = new System.Drawing.Point(168, 26); this.txtUser.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtUser.Name = "txtUser"; this.txtUser.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 10F); @@ -102,7 +88,7 @@ // // ckRemember // - this.ckRemember.Location = new System.Drawing.Point(168, 139); + this.ckRemember.Location = new System.Drawing.Point(168, 121); this.ckRemember.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.ckRemember.Name = "ckRemember"; this.ckRemember.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 10F); @@ -117,7 +103,7 @@ // txtPwd // this.txtPwd.EditValue = ""; - this.txtPwd.Location = new System.Drawing.Point(168, 53); + this.txtPwd.Location = new System.Drawing.Point(168, 72); this.txtPwd.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtPwd.Name = "txtPwd"; this.txtPwd.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 10F); @@ -134,28 +120,12 @@ this.btnCancel.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.HotFlat; this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand; this.btnCancel.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnCancel.ImageOptions.Image"))); - this.btnCancel.Location = new System.Drawing.Point(276, 192); + this.btnCancel.Location = new System.Drawing.Point(276, 174); this.btnCancel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(103, 37); this.btnCancel.TabIndex = 15; this.btnCancel.Text = "鍙栨秷 (&C)"; - // - // labelControl3 - // - this.labelControl3.Appearance.Font = new System.Drawing.Font("Tahoma", 10F); - this.labelControl3.Appearance.ForeColor = System.Drawing.Color.Black; - this.labelControl3.Appearance.Options.UseFont = true; - this.labelControl3.Appearance.Options.UseForeColor = true; - this.labelControl3.Appearance.Options.UseTextOptions = true; - this.labelControl3.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; - this.labelControl3.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None; - this.labelControl3.Location = new System.Drawing.Point(3, 102); - this.labelControl3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.labelControl3.Name = "labelControl3"; - this.labelControl3.Size = new System.Drawing.Size(162, 18); - this.labelControl3.TabIndex = 233; - this.labelControl3.Text = "缁勭粐鏈烘瀯锛�"; // // btnLogin // @@ -164,7 +134,7 @@ this.btnLogin.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.HotFlat; this.btnLogin.Cursor = System.Windows.Forms.Cursors.Hand; this.btnLogin.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnLogin.ImageOptions.Image"))); - this.btnLogin.Location = new System.Drawing.Point(159, 192); + this.btnLogin.Location = new System.Drawing.Point(159, 174); this.btnLogin.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnLogin.Name = "btnLogin"; this.btnLogin.Size = new System.Drawing.Size(102, 37); @@ -180,7 +150,7 @@ this.labelControl2.Appearance.Options.UseTextOptions = true; this.labelControl2.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; this.labelControl2.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None; - this.labelControl2.Location = new System.Drawing.Point(3, 59); + this.labelControl2.Location = new System.Drawing.Point(3, 78); this.labelControl2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.labelControl2.Name = "labelControl2"; this.labelControl2.Size = new System.Drawing.Size(162, 18); @@ -196,7 +166,7 @@ this.labelControl1.Appearance.Options.UseTextOptions = true; this.labelControl1.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; this.labelControl1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None; - this.labelControl1.Location = new System.Drawing.Point(3, 15); + this.labelControl1.Location = new System.Drawing.Point(3, 32); this.labelControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.labelControl1.Name = "labelControl1"; this.labelControl1.Size = new System.Drawing.Size(162, 18); @@ -250,11 +220,9 @@ private DevExpress.XtraEditors.CheckEdit ckRemember; private DevExpress.XtraEditors.TextEdit txtPwd; private DevExpress.XtraEditors.SimpleButton btnCancel; - private DevExpress.XtraEditors.LabelControl labelControl3; private DevExpress.XtraEditors.SimpleButton btnLogin; private DevExpress.XtraEditors.LabelControl labelControl2; private DevExpress.XtraEditors.LabelControl labelControl1; - private System.Windows.Forms.ComboBox comOrg; private System.Windows.Forms.Label label1; } } \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/FrmLogin.cs b/DevApp/Gs.DevApp/DevFrm/FrmLogin.cs index 4000d62..61a5fbe 100644 --- a/DevApp/Gs.DevApp/DevFrm/FrmLogin.cs +++ b/DevApp/Gs.DevApp/DevFrm/FrmLogin.cs @@ -20,40 +20,12 @@ if (ConfigurationManager.AppSettings["IsAutoUpdater"] == "1") _autoUpdate(); else - getTree(); + _getRemember(); Text = lbVersion.Text = ConfigurationManager.AppSettings["ProductName"]; btnLogin.Click += BtnLogin_Click; btnCancel.Click += BtnCancel_Click; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); - } - - /// <summary> - /// 璇诲彇缁勭粐 - /// </summary> - private void getTree() - { - var pgq = new PageQueryModel(1, 999999, "FID", "asc", "", - " and IS_STATUS=1"); - var json = JsonConvert.SerializeObject(pgq); - try - { - var strReturn = UtilityHelper.HttpPost("", - "Organization/GetListPage", json); - var rtn = UtilityHelper.ReturnToTablePage(strReturn); - var dt = rtn.rtnData.list; - comOrg.DataSource = dt; - comOrg.DisplayMember = "name"; - comOrg.ValueMember = "guid"; - comOrg.SelectedIndex = 0; - _getRemember(); - } - catch (Exception ex) - { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); - Close(); - Application.Exit(); - } } private void BtnCancel_Click(object sender, EventArgs e) @@ -76,20 +48,10 @@ txtUser.Focus(); return; } - - if (comOrg.SelectedValue == null || - string.IsNullOrEmpty(comOrg.SelectedValue.ToString().Trim())) - { - MsgHelper.Warning("缁勭粐鏈烘瀯涓嶈兘涓虹┖锛�"); - txtUser.Focus(); - return; - } - var _obj = new { accountPwd = txtPwd.Text.Trim(), accountNo = txtUser.Text.Trim(), - orgGuid = comOrg.SelectedValue.ToString().Trim() }; try { @@ -99,23 +61,12 @@ JObject _login = _rtn.rtnData; if (_rtn.rtnCode > 0) { - Settings.Default.userName = ckRemember.Checked - ? txtUser.Text.Trim() - : ""; - Settings.Default.userPwd = - ckRemember.Checked ? txtPwd.Text.Trim() : ""; - Settings.Default.orgGuid = ckRemember.Checked - ? comOrg.SelectedValue.ToString() - : ""; + Settings.Default.userName = ckRemember.Checked? txtUser.Text.Trim() : ""; + Settings.Default.userPwd = ckRemember.Checked ? txtPwd.Text.Trim() : ""; Settings.Default.remember = ckRemember.Checked; Settings.Default.Save(); - LoginInfoModel.CurrentUser.LoginUserGuid = - _login["loginGuid"].ToString(); - LoginInfoModel.CurrentUser.LoginOrgGuid = - _login["loginOrgGuid"].ToString(); - LoginInfoModel.CurrentUser.LoginTime = - DateTime.Now.ToString("yyyy-MM-dd hh:mm"); - + LoginInfoModel.CurrentUser.LoginUserGuid = _login["loginGuid"].ToString(); + LoginInfoModel.CurrentUser.LoginTime = DateTime.Now.ToString("yyyy-MM-dd hh:mm"); DialogResult = DialogResult.OK; } else @@ -142,7 +93,6 @@ { txtUser.Text = Settings.Default.userName; txtPwd.Text = Settings.Default.userPwd; - comOrg.SelectedValue = Settings.Default.orgGuid; ckRemember.Checked = true; } } @@ -173,7 +123,6 @@ if (!args.IsUpdateAvailable) { - getTree(); return; } diff --git a/DevApp/Gs.DevApp/DevFrm/FrmMain.cs b/DevApp/Gs.DevApp/DevFrm/FrmMain.cs index 1e46382..3e20974 100644 --- a/DevApp/Gs.DevApp/DevFrm/FrmMain.cs +++ b/DevApp/Gs.DevApp/DevFrm/FrmMain.cs @@ -180,7 +180,6 @@ var _obj = new { userGuid = LoginInfoModel.CurrentUser.LoginUserGuid, - orgGuid = LoginInfoModel.CurrentUser.LoginOrgGuid }; try { diff --git a/DevApp/Gs.DevApp/Entity/LoginInfoModel.cs b/DevApp/Gs.DevApp/Entity/LoginInfoModel.cs index e4c5bdc..feb3032 100644 --- a/DevApp/Gs.DevApp/Entity/LoginInfoModel.cs +++ b/DevApp/Gs.DevApp/Entity/LoginInfoModel.cs @@ -4,19 +4,10 @@ { private static LoginInfoModel _CurrentUser; - //鐧诲綍缁勭粐缂栧彿 - - //鐧诲綍鏃堕棿 - /// <summary> /// 鐧诲綍鐢ㄦ埛鐨刧uid /// </summary> public string LoginUserGuid { get; set; } = ""; - - /// <summary> - /// 鐧诲綍鐢ㄦ埛鐨勭粍缁� orgGuid - /// </summary> - public string LoginOrgGuid { get; set; } = ""; public string LoginTime { get; set; } diff --git a/DevApp/Gs.DevApp/Properties/Settings.Designer.cs b/DevApp/Gs.DevApp/Properties/Settings.Designer.cs index b64b539..1be3dec 100644 --- a/DevApp/Gs.DevApp/Properties/Settings.Designer.cs +++ b/DevApp/Gs.DevApp/Properties/Settings.Designer.cs @@ -1,9 +1,10 @@ 锘�//------------------------------------------------------------------------------ // <auto-generated> -// This code was generated by a tool. +// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆� +// 杩愯鏃剁増鏈�:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳戒細瀵艰嚧涓嶆纭殑琛屼负锛屽苟涓斿鏋� +// 閲嶆柊鐢熸垚浠g爜锛岃繖浜涙洿鏀瑰皢浼氫涪澶便�� // </auto-generated> //------------------------------------------------------------------------------ @@ -11,7 +12,7 @@ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.12.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -55,18 +56,6 @@ } set { this["remember"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] - public string orgGuid { - get { - return ((string)(this["orgGuid"])); - } - set { - this["orgGuid"] = value; } } diff --git a/DevApp/Gs.DevApp/Properties/Settings.settings b/DevApp/Gs.DevApp/Properties/Settings.settings index c34a1c3..2759b8d 100644 --- a/DevApp/Gs.DevApp/Properties/Settings.settings +++ b/DevApp/Gs.DevApp/Properties/Settings.settings @@ -1,27 +1,21 @@ 锘�<?xml version='1.0' encoding='utf-8'?> -<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" - CurrentProfile="(Default)" - GeneratedClassNamespace="Gs.DevApp.Properties" - GeneratedClassName="Settings"> - <Profiles/> - <Settings> - <Setting Name="userName" Type="System.String" Scope="User"> - <Value Profile="(Default)"/> - </Setting> - <Setting Name="userPwd" Type="System.String" Scope="User"> - <Value Profile="(Default)"/> - </Setting> - <Setting Name="remember" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">False</Value> - </Setting> - <Setting Name="orgGuid" Type="System.String" Scope="User"> - <Value Profile="(Default)"/> - </Setting> - <Setting Name="fontSize" Type="System.Single" Scope="User"> - <Value Profile="(Default)">10</Value> - </Setting> - <Setting Name="fontName" Type="System.String" Scope="User"> - <Value Profile="(Default)">Tahoma</Value> - </Setting> - </Settings> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Gs.DevApp.Properties" GeneratedClassName="Settings"> + <Profiles /> + <Settings> + <Setting Name="userName" Type="System.String" Scope="User"> + <Value Profile="(Default)" /> + </Setting> + <Setting Name="userPwd" Type="System.String" Scope="User"> + <Value Profile="(Default)" /> + </Setting> + <Setting Name="remember" Type="System.Boolean" Scope="User"> + <Value Profile="(Default)">False</Value> + </Setting> + <Setting Name="fontSize" Type="System.Single" Scope="User"> + <Value Profile="(Default)">10</Value> + </Setting> + <Setting Name="fontName" Type="System.String" Scope="User"> + <Value Profile="(Default)">Tahoma</Value> + </Setting> + </Settings> </SettingsFile> \ No newline at end of file diff --git a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs index d982fa0..d6b0c51 100644 --- a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs +++ b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs @@ -671,7 +671,6 @@ var _obj = new { userGuid = LoginInfoModel.CurrentUser.LoginUserGuid, - orgGuid = LoginInfoModel.CurrentUser.LoginOrgGuid, formNamespace = _formNamespace }; var strReturn = ""; -- Gitblit v1.9.3