12345678910111213141516171819202122232425262728293031323334353637383940 |
- using Central.Control.WebApi.Cache;
- using Central.Control.WebApi.DbEntity;
- using Central.Control.WebApi.Service.Interface;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace Central.Control.WebApi.Service
- {
- /// <summary>
- ///
- /// </summary>
- public class UserService: IUserService
- {
- private readonly ICacheHelper _cacheHelper;
- /// <summary>
- ///
- /// </summary>
- /// <param name="cacheHelper"></param>
- public UserService(
- ICacheHelper cacheHelper)
- {
- _cacheHelper = cacheHelper;
- }
- /// <summary>
- /// 获取当前登录session
- /// </summary>
- /// <returns></returns>
- public SYS_LoginSession GetLoginSession()
- {
- string token = string.Empty;
- token = HttpContext.Current.Request.Headers.GetValues("token")?.FirstOrDefault();
- return _cacheHelper.Get<SYS_LoginSession>(token);
- }
- }
- }
|