You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.0 KiB

using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using APP.Models;
namespace APP.Controllers
{
public class LoginController : Controller
{
public IActionResult Index()
{
return View();
}
public IActionResult Login(LoginModel model)
{
App.Helper.HttpClientHelper httpcli = new App.Helper.HttpClientHelper();
string username = model.UserName;
string password = model.Password;
httpcli.CallService("user",username+','+password, "GET", null);
if (httpcli.Results.resultstatus==true && httpcli.Results.daten !="[]")
{
APP.Models.SessionClass.UserName = "AAA";
return Json(new { success = true });
}
else
{
return Json(new { error = "Kann nicht angemeldet werden!" });
};
return Json(new { error = "" });
}
}
}