Ejemplo n.º 1
0
        /// <summary>
        /// 注销
        /// </summary>
        public bool Logout()
        {
            var token = GetToken();

            if (String.IsNullOrEmpty(token))
            {
                return(true);
            }

            try
            {
                _unitWork.Delete <SysUserOnline>(u => u.Token.Equals(token));
            }
            catch (Exception)
            {
            }

            try
            {
                _cacheContext.Remove(token);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
 public bool Logout(string token, string requestid = "")
 {
     try
     {
         _cacheContext.Remove(token);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 添加/编辑用户
        /// </summary>
        /// <param name="userDto"></param>
        /// <returns></returns>
        public string AddorEditDict(SysDataDictionary model)
        {
            var resModel  = new ResponseModel();
            var userLogin = injection.GetT <Data.UserAccount>().GetUserInfo();
            var mModel    = injection.GetT <ISysDataDictionaryBLL>().AddorEditDict(model, userLogin.UserId);

            resModel.StateCode = mModel.Result ? StatesCode.success : StatesCode.failure;
            resModel.Messages  = mModel.Message;
            resModel.JsonData  = mModel.Data;
            if (mModel.Result)
            {
                _cacheContext.Remove("SysName");
            }
            return(JsonHelper.ObjectToJson(resModel));
        }
Ejemplo n.º 4
0
        public Response <bool> Logout(string token)
        {
            var resp = new Response <bool>();

            try
            {
                resp.Result = _cacheContext.Remove(token);
            }
            catch (Exception e)
            {
                resp.Result  = false;
                resp.Message = e.Message;
            }
            return(resp);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 注销
        /// </summary>
        public bool Logout()
        {
            var token = GetToken();

            if (String.IsNullOrEmpty(token))
            {
                return(true);
            }

            try
            {
                _cacheContext.Remove(token);
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }