AboutController.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using GxPress.Common.Tools;
  2. using GxPress.Result.About;
  3. using Microsoft.AspNetCore.Authorization;
  4. using Microsoft.AspNetCore.Mvc;
  5. namespace GxPress.Api.AppControllers
  6. {
  7. /// <summary>
  8. /// app
  9. /// </summary>
  10. [Route("api/app/about")]
  11. [ApiController]
  12. [Authorize]
  13. public class AboutController : ControllerBase
  14. {
  15. /// <summary>
  16. /// 关于 对付对付
  17. /// </summary>
  18. /// <returns></returns>
  19. [HttpGet("info")]
  20. public AboutResult About()
  21. {
  22. var addressUrlDownload = ConfigHelper.GetValue("ServiceAddress:AddressUrlDownload");
  23. var aboutResult = new AboutResult
  24. {
  25. AboutUrl = StringUtils.AddDomain("/static/aboutus.html"),
  26. DownloadUrl = StringUtils.AddDomain($"{addressUrlDownload}/d")
  27. };
  28. return aboutResult;
  29. }
  30. [HttpGet("register")]
  31. [AllowAnonymous]
  32. public bool IsRegister()
  33. {
  34. var isRegisterValue = ConfigHelper.GetValue("ServiceAddress:IsRegister");
  35. if (bool.TryParse(isRegisterValue, out bool isRegister))
  36. return isRegister;
  37. return false;
  38. }
  39. }
  40. }