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.

46 lines
1.4 KiB

2 years ago
  1. using EasyBL;
  2. using EasyBL.WebApi.Filters;
  3. using EasyBL.WEBAPP;
  4. using System;
  5. using System.Net.Http;
  6. using System.Web.Http;
  7. namespace WebApp.Controllers
  8. {
  9. public class ServiceController : ApiController
  10. {
  11. /// <summary>
  12. /// 获取token
  13. /// </summary>
  14. /// <param name="orgId"></param>
  15. /// <param name="userId"></param>
  16. /// <param name="pasWd"></param>
  17. /// <returns></returns>
  18. [HttpGet]
  19. [ApiSecurityFilter]
  20. public HttpResponseMessage GetToken(string orgId, string userId, string pasWd)
  21. {
  22. return new BaseAuthorizeService().GetToken(orgId, userId, pasWd);
  23. }
  24. /// <summary>
  25. /// 後臺登陸
  26. /// </summary>
  27. /// <param name="data"></param>
  28. /// <returns></returns>
  29. [HttpPost]
  30. [ApiSecurityFilter]
  31. public HttpResponseMessage GetLogin([FromBody]dynamic data)
  32. {
  33. try
  34. {
  35. return new AuthorizeService().GetLogin(data, Request);
  36. }
  37. catch (Exception ex)
  38. {
  39. var sMsg = Util.GetLastExceptionMsg(ex);
  40. LogService.MailSend(sMsg + @"Param:", ex, @"TE", @"apadmin", nameof(ServiceController), @"登陸", @"GetLogin(系統登陸)", @"", @"", @"");
  41. return null;
  42. }
  43. }
  44. }
  45. }