fix_WPF_switch_user_main_loop_conflict

This commit is contained in:
2026-08-05 17:27:02 +08:00
parent 66cab000ea
commit 031fc34f12
+12 -3
View File
@@ -428,10 +428,19 @@ namespace Lskj.Main
ERPInfo.Instance.UserId = userId;
ERPInfo.Instance.UserName = userName;
this.Close();
IniHelper.Write("isRefresh", "1");
Manager.ReStartMain(true);
//this.DialogResult = System.Windows.Forms.DialogResult.OK;
if (Manager.ExternalMainShell == null)
{
this.Close();
Manager.ReStartMain(true);
}
else
{
// WPF 已接管主窗口生命周期:只返回切换成功,
// 由 WPF 在当前模态窗体关闭后重建主框架。
this.DialogResult = System.Windows.Forms.DialogResult.OK;
this.Close();
}
break;
case 1: // 密码不正确
MessageUtil.Show(ResourceKeys.NameOrPasswordError);