예제 #1
0
        public WxOperatorModel GetCurrent()
        {
            string cookieString = string.Empty;

            StaticHttpContext.Current.Request.Cookies.TryGetValue(WeixinAppKey, out cookieString);
            if (!string.IsNullOrEmpty(cookieString))
            {
                WxOperatorModel wxOperatorModel = new WxOperatorModel();
                wxOperatorModel = DESEncrypt.Decrypt(cookieString).ToObject <WxOperatorModel>();
                return(wxOperatorModel);
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
 public void AddCurrent(WxOperatorModel wxOperatorModel)
 {
     StaticHttpContext.Current.Response.Cookies.Append(WeixinAppKey, DESEncrypt.Encrypt(wxOperatorModel.ToJson()));
 }