public override void Handler(LoginContext context) { if (context.UserName == "1234") { Console.WriteLine("成功"); } else { context.State = new FailState(); context.Request(); } }
public override void Handler(LoginContext context) { if (context.UserName != "1234") { Console.WriteLine("失败!"); } else { context.State = new SuccessState(); context.Request(); } }