Ejemplo n.º 1
0
        public IActionResult GetAllInfo()
        {
            CommonResult        result              = new CommonResult();
            YuebonCacheHelper   yuebonCacheHelper   = new YuebonCacheHelper();
            SysSetting          sysSetting          = yuebonCacheHelper.Get("SysSetting").ToJson().ToObject <SysSetting>();
            SysSettingOutputDto sysSettingOutputDto = new SysSettingOutputDto();

            if (sysSetting == null)
            {
                sysSetting = XmlConverter.Deserialize <SysSetting>("xmlconfig/sys.config");
            }

            //对关键信息解密
            if (!string.IsNullOrEmpty(sysSetting.Email))
            {
                sysSetting.Email = DEncrypt.Decrypt(sysSetting.Email);
            }
            if (!string.IsNullOrEmpty(sysSetting.Emailsmtp))
            {
                sysSetting.Emailsmtp = DEncrypt.Decrypt(sysSetting.Emailsmtp);
            }
            if (!string.IsNullOrEmpty(sysSetting.Emailpassword))
            {
                sysSetting.Emailpassword = DEncrypt.Decrypt(sysSetting.Emailpassword);
            }
            if (!string.IsNullOrEmpty(sysSetting.Smspassword))
            {
                sysSetting.Smspassword = DEncrypt.Decrypt(sysSetting.Smspassword);
            }
            if (!string.IsNullOrEmpty(sysSetting.Smsusername))
            {
                sysSetting.Smsusername = DEncrypt.Decrypt(sysSetting.Smsusername);
            }
            sysSettingOutputDto = sysSetting.MapTo <SysSettingOutputDto>();
            if (sysSettingOutputDto != null)
            {
                sysSettingOutputDto.CopyRight = UIConstants.CopyRight;
                result.ResData = sysSettingOutputDto;
                result.Success = true;
                result.ErrCode = ErrCode.successCode;
            }
            else
            {
                result.ErrMsg  = ErrCode.err60001;
                result.ErrCode = "60001";
            }
            return(ToJsonContent(result));
        }
Ejemplo n.º 2
0
        public IActionResult GetInfo()
        {
            CommonResult        result              = new CommonResult();
            YuebonCacheHelper   yuebonCacheHelper   = new YuebonCacheHelper();
            SysSetting          sysSetting          = yuebonCacheHelper.Get("SysSetting").ToJson().ToObject <SysSetting>();
            SysSettingOutputDto sysSettingOutputDto = new SysSettingOutputDto();

            if (sysSetting == null)
            {
                sysSetting = XmlConverter.Deserialize <SysSetting>("xmlconfig/sys.config");
            }
            sysSetting.Email         = "";
            sysSetting.Emailsmtp     = "";
            sysSetting.Emailpassword = "";
            sysSetting.Smspassword   = "";
            sysSetting.SmsSignName   = "";
            sysSetting.Smsusername   = "";
            sysSettingOutputDto      = sysSetting.MapTo <SysSettingOutputDto>();
            if (sysSettingOutputDto != null)
            {
                sysSettingOutputDto.CopyRight = UIConstants.CopyRight;
                result.ResData = sysSettingOutputDto;
                result.Success = true;
                result.ErrCode = ErrCode.successCode;
            }
            else
            {
                result.ErrMsg  = ErrCode.err60001;
                result.ErrCode = "60001";
            }

            IEnumerable <APP> appList = aPPService.GetAllByIsNotDeleteAndEnabledMark();

            yuebonCacheHelper.Add("AllowAppId", appList);
            return(ToJsonContent(result));
        }