//[Route("authenticate")]
        public IHttpActionResult Authenticate(AuthenticateViewModel viewModel)
        {
            if (!ValidUser(viewModel.Username, viewModel.Password))
            {
                return Ok(new { success = false, message = "請確認您的帳號密碼!" });
            }

            return Ok(new { success = true, token=viewModel.Username });
        }
Exemple #2
0
        //[Route("authenticate")]
        public IHttpActionResult Authenticate(AuthenticateViewModel viewModel)
        {
            if (!ValidUser(viewModel.Username, viewModel.Password))
            {
                return(Ok(new { success = false, message = "請確認您的帳號密碼!" }));
            }

            return(Ok(new { success = true, token = viewModel.Username }));
        }