Beispiel #1
0
        public ApiReturnModel GetUserBasicsData()
        {
            var userInfo = GetCurrentUserInfo();

            userInfo = UserBusiness.GetItemById(userInfo.Id);

            var token = Request.Headers.Authorization.Parameter;

            CacheHelper.TryAddCache($"{token}-{AuthenticationPara.UserAuthentication}", userInfo, DateTime.Now.AddDays(30)); //更新缓存

            ApiUserInfoModel apiUserInfoModel = new ApiUserInfoModel()
            {
                CompanyName = userInfo.CompanyName,
                UserName    = userInfo.UserName,
                UserLv      = UserRoleBusiness.GetItemById(userInfo.UserLv).RoleName
            };

            return(ApiReturnModel.ReturnOk("查询成功", apiUserInfoModel));
        }