public UserWithAccessedCtrls GetUser(string token, string requestid = "") { string userName = GetUserName(token, requestid); if (!string.IsNullOrEmpty(userName)) { return(_app.GetAccessedControls(userName)); } return(null); }
public string GetUser(string token = "", string requestid = "") { string userName = GetUserName(token, requestid); if (!string.IsNullOrEmpty(userName)) { return(JsonHelper.Instance.Serialize(_app.GetAccessedControls(userName))); } return(string.Empty); }
/// <summary> /// 获取当前登录的用户信息 /// <para>通过URL中的Token参数或Cookie中的Token</para> /// </summary> /// <param name="otherInfo">The otherInfo.</param> /// <returns>LoginUserVM.</returns> public UserWithAccessedCtrls GetCurrentUser(string otherInfo = "") { try { var userctrls = new UserWithAccessedCtrls(); var user = _objCacheProvider.GetCache(GetToken()); if (user != null) { userctrls = _app.GetAccessedControls(user.Account); } return(userctrls); } catch (Exception ex) { throw ex; } }
public Response <UserWithAccessedCtrls> GetUser(string token, string requestid = "") { var result = new Response <UserWithAccessedCtrls>(); try { var user = _objCacheProvider.GetCache(token); if (user != null) { result.Result = _app.GetAccessedControls(user.Account); } } catch (Exception ex) { result.Code = 500; result.Message = ex.InnerException != null ? "OpenAuth.WebAPI数据库访问失败:" + ex.InnerException.Message : "OpenAuth.WebAPI数据库访问失败:" + ex.Message; } return(result); }