From 7046cae6e895723674014339c38e3caa2078056f Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Mon, 22 Jun 2020 16:48:49 +0800 Subject: [PATCH] update Former-commit-id: 0eec9f49fd0270a233285857ad06f3effe8db6a7 Former-commit-id: a7ea6687a8d546b01f74b2145712609ff2accb31 --- projects/UserCenter/Api/TokenController.cs | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/projects/UserCenter/Api/TokenController.cs b/projects/UserCenter/Api/TokenController.cs index f47189c9..7c63c68e 100644 --- a/projects/UserCenter/Api/TokenController.cs +++ b/projects/UserCenter/Api/TokenController.cs @@ -35,7 +35,7 @@ namespace UserCenter.Controllers } [HttpPost] - public ActionResult GetToken([FromBody]LoginModel model) + public ActionResult GetToken([FromBody] LoginModel model) { try { @@ -110,7 +110,7 @@ namespace UserCenter.Controllers } [HttpPost] - public ActionResult RefreshToken([FromBody][Required(ErrorMessage = nameof(RequiredAttribute))]string refreshToken) + public ActionResult RefreshToken([FromBody][Required(ErrorMessage = nameof(RequiredAttribute))] string refreshToken) { try { @@ -132,5 +132,25 @@ namespace UserCenter.Controllers return Problem(ex.Message); } } + + public IActionResult GetLayout() + { + try + { + return Ok(new + { + logo = this._settingService.GetSetting("logo").Value, + name = this._settingService.GetSetting("name").Value, + copyright = this._settingService.GetSetting("copyright").Value, + version = Helper.Instance.GetVersion(), + username = this.HttpContext.User.Identity.IsAuthenticated ? this.HttpContext.User.Identity.Name : null + }); + } + catch (Exception ex) + { + ex.PrintStack(); + return Problem(ex.Message); + } + } } } \ No newline at end of file