2021-04-26 11:29:45 +08:00
|
|
|
|
using NX.ERP.WebAPi.models;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Web;
|
|
|
|
|
|
using System.Web.Http;
|
|
|
|
|
|
namespace NX.ERP.WebAPi.Controllers.System
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public class SystemController:ApiController
|
|
|
|
|
|
{
|
2021-06-07 15:45:37 +08:00
|
|
|
|
|
2021-04-26 11:29:45 +08:00
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[Route("api/System/Login")]
|
|
|
|
|
|
public string Login(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/Userrole")]
|
|
|
|
|
|
public string Userrole(LoginEntity loginEntity)
|
|
|
|
|
|
{
|
|
|
|
|
|
var Userrole = new NX.ERP.U8.User.User();
|
|
|
|
|
|
return Userrole.Userrole(loginEntity.UserId, loginEntity.Password);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2021-04-26 11:29:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|