Пример #1
0
        public static void SaveToSession(XT_LOGIN_INFO info)
        {
            XT_LoginInfoService service = ServiceManage.GetService <XT_LoginInfoService>();

            service.Insert(info);
            string key   = Base64Ulits.EncryptBase64(AppConfigManage.GetSysUserSessionFlag());
            string value = value = Base64Ulits.EncryptBase64(info.ID);

            value = Base64Ulits.EncryptBase64(value);
            SessionUlits.Save(key, value);
        }
Пример #2
0
        /// <summary>
        /// 获取客服端用户登录的信息
        /// </summary>
        /// <returns></returns>
        public static XT_LOGIN_INFO GetLoginInfo()
        {
            string key     = Base64Ulits.EncryptBase64(AppConfigManage.GetSysUserSessionFlag());
            string loginId = (string)SessionUlits.GetData(key);

            if (string.IsNullOrWhiteSpace(loginId))
            {
                return(null);
            }
            loginId = Base64Ulits.DecryptBase64(loginId);
            loginId = Base64Ulits.DecryptBase64(loginId);
            XT_LoginInfoService service = ServiceManage.GetService <XT_LoginInfoService>();
            SQLHelper           helper  = new SQLHelper("select * from XT_LOGIN_INFO where ID=@0", loginId);
            XT_LOGIN_INFO       info    = service.SelectFirstOrDefault(helper);

            return(info);
        }