mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
31 lines
805 B
C#
31 lines
805 B
C#
using System.Web.Mvc;
|
|
using OpenAuth.App;
|
|
using OpenAuth.App.DTO;
|
|
using OpenAuth.Domain.Service;
|
|
using OpenAuth.Repository.Repository;
|
|
|
|
namespace OpenAuth.Web.Controllers
|
|
{
|
|
public class AccountController : Controller
|
|
{
|
|
//
|
|
// GET: /Account/
|
|
|
|
public ActionResult Login()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
[HttpPost]
|
|
public ActionResult Login(string username, string password)
|
|
{
|
|
var request = new LoginRequest { UserName = username, Password = password };
|
|
var loginApp = new LoginApp(new LoginService(new UserRepository()));
|
|
var response = loginApp.Login(request);
|
|
LoginCacheApp.SetLogin(response);
|
|
return Json(new { response.Success, response.Message });
|
|
}
|
|
|
|
}
|
|
}
|