示例#1
0
        public ActionResult Index(AuthenticationViewModel model)
        {
            var result = Client.PostAsJsonAsync("authentication", model).Result;

            if (result.StatusCode == HttpStatusCode.OK)
            {
                FormsAuthentication.SetAuthenticationToken(result.Content.ReadAsAsync <string>().Result);
                return(RedirectToAction("Index", "Home"));
            }

            return(View());
        }