Files
U8-Import/NX.ERP.WebAPi/Controllers/System/SystemController.cs

59 lines
1.7 KiB
C#
Raw Normal View History

using NX.ERP.WebAPi.models;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using System.Web.Http;
namespace NX.ERP.WebAPi.Controllers.System
{
public class SystemController : ApiController
{
[HttpPost]
[Route("api/System/BOLogin")]
public string BOLogin(LoginEntity loginEntity)
{
var AccID = ConfigurationManager.AppSettings["AccId"];
//NX.ERP.U8.U8LoginContext.Instance.PassWord = System.Configuration.ConfigurationManager.AppSettings["Password"];
//NX.ERP.U8.U8LoginContext.Instance.UserId = System.Configuration.ConfigurationManager.AppSettings["UserId"];
var Server = ConfigurationManager.AppSettings["Server"];
var _login = new NX.ERP.U8.U8LoginContext(Server, AccID);
_login.Login(loginEntity.UserId, loginEntity.Password);
return _login.loginId;
}
2021-05-22 16:38:37 +08:00
[HttpPost]
[Route("api/System/Login")]
public bool Login(LoginEntity loginEntity)
{
if (string.IsNullOrEmpty(loginEntity.Password) || string.IsNullOrEmpty(loginEntity.UserId))
{
return false;
}
//密码密文
var userDal = new U8.User.UserDal();
return userDal.Login(loginEntity.UserId, loginEntity.Password);
}
2021-05-22 16:38:37 +08:00
[HttpPost]
[Route("api/System/Userrole")]
public string Userrole(LoginEntity loginEntity)
{
2021-10-28 11:14:04 +08:00
var Userrole = new NX.ERP.U8.User.UserDal();
2021-05-22 16:38:37 +08:00
return Userrole.Userrole(loginEntity.UserId, loginEntity.Password);
}
}
}