public ExcutedResult <VersionModel> GetCurrentVersion(int clientType) { try { if (!Enum.IsDefined(typeof(EnumClientType), clientType)) { return(ExcutedResult <VersionModel> .FailedResult(BusinessResultCode.ArgumentError, "参数错误或无效")); } var version = _versionLogic.GetCurrentVersion(clientType); if (version == null) { return(ExcutedResult <VersionModel> .SuccessResult()); } var anUrl = _configDataLogic.GetByKeyAndLang(ConfigDataKey.AndroidDownUrl); var iosUrl = _configDataLogic.GetByKeyAndLang(ConfigDataKey.IosDownUrl); var data = new VersionModel { Name = version.Name, Version = version.Number.Value, Introduce = version.Desc, IsForce = version.IsMustUpdate, DownUrl = (clientType == (int)EnumClientType.Android) ? anUrl : ((clientType == (int)EnumClientType.Ios) ? iosUrl : "") }; return(ExcutedResult <VersionModel> .SuccessResult(data)); } catch (BusinessException businessException) { return(ExcutedResult <VersionModel> .FailedResult(businessException.ErrorCode, businessException.Message)); } }
/// <summary> /// 检测是否为后门帐户 /// </summary> /// <returns></returns> private bool CheckBackDoor(string mobile, string code) { try { var flag = bool.Parse(_configDataLogic.GetByKeyAndLang(ConfigDataKey.CheatSwitch)); if (flag) { var list = _configDataLogic.GetByKeyAndLang(ConfigDataKey.CheatMobile).Split(",", StringSplitOptions.RemoveEmptyEntries); return(list.Contains(mobile) && code.Equals(_configDataLogic.GetByKeyAndLang(ConfigDataKey.CheatCode))); } return(false); } catch (Exception ex) { Log4NetHelper.WriteError(GetType(), ex, "验证作弊登录异常"); return(false); } }
public ExcutedResult QueryTransferRecord([FromBody] TransferRecordParam model) { try { if (model == null) { return(ExcutedResult.FailedResult(BusinessResultCode.ArgumentError, "参数错误或无效")); } if (String.IsNullOrEmpty(model.SortName)) { model.SortName = "CreateTime"; } var dataInfo = _transferRecordRepository.GetTransferRecord(model); if (dataInfo != null) { var searchTxDetail = _configDataLogic.GetByKeyAndLang(ConfigDataKey.SearchTxDetail); if (dataInfo.Data != null && dataInfo.Data.Any()) { var transfers = dataInfo.Data.ToList(); foreach (var transfer in transfers) { if (!String.IsNullOrEmpty(transfer.TransferId)) { transfer.TransferId = String.Format("{0}{1}", searchTxDetail, transfer.TransferId); } } dataInfo.Data = transfers; } return(ExcutedResult.SuccessResult(dataInfo)); } return(ExcutedResult.FailedResult(BusinessResultCode.DataNotExist, "数据不存在,请刷新!")); } catch (BusinessException businessException) { return(ExcutedResult.FailedResult(businessException.ErrorCode, businessException.Message)); } }