/// <summary> /// 执行 /// </summary> /// <param name="param">参数</param> /// <param name="paramIndex">参数索引位置</param> /// <returns>返回信息</returns> public BasicReturnInfo Exec(object[] param, byte paramIndex = 0) { BasicReturnInfo returnInfo = new BasicReturnInfo(); if (Convert.ToInt32(param[paramIndex]) < 0) { returnInfo.SetFailureMsg("页码必须大于或等于0"); return(returnInfo); } int pageSize = Convert.ToInt32(param[paramIndex + 1]); if (pageSize < 1) { returnInfo.SetFailureMsg("每页记录数必须大于0"); return(returnInfo); } if (App.MaxPageSize != -1 && pageSize > App.MaxPageSize) { returnInfo.SetFailureMsg($"每页记录数已经超过了最大记录数:{App.MaxPageSize}"); return(returnInfo); } return(returnInfo); }
/// <summary> /// 执行 /// </summary> /// <param name="param">参数</param> /// <param name="paramIndex">参数索引位置</param> /// <returns>返回信息</returns> public BasicReturnInfo Exec(object[] param, byte paramIndex = 0) { BasicReturnInfo returnInfo = new BasicReturnInfo(); if (param[paramIndex] == null) { returnInfo.SetFailureMsg("数组不能为null"); return(returnInfo); } if (param[paramIndex] is Array) { Array array = param[paramIndex] as Array; if (array.Length == 0) { returnInfo.SetFailureMsg("数组长度必须大于0"); return(returnInfo); } } else { returnInfo.SetFailureMsg("对象不是数组"); } return(returnInfo); }
/// <summary> /// 拦截 /// </summary> /// <param name="basicReturn">基本返回</param> /// <param name="invocation">拦截参数</param> /// <param name="attr">特性</param> /// <param name="isExecProceeded">是否已执行</param> protected override void Intercept(BasicReturnInfo basicReturn, IInvocation invocation, FunctionAttribute attr, out bool isExecProceeded) { isExecProceeded = false; var ignorePerAttr = invocation.Method.GetAttribute <IgnorePermissionAttribute>(); if (ignorePerAttr != null) { return; } if (attr.Codes.IsNullOrCount0()) { basicReturn.SetFailureMsg("功能编码不能为空"); return; } MenuAttribute menuAttr = invocation.TargetType.GetAttribute <MenuAttribute>(); if (menuAttr == null) { return; } if (string.IsNullOrWhiteSpace(menuAttr.Code)) { basicReturn.SetFailureMsg("菜单编码不能为空"); return; } // 这里执行权限验证 IUserService userService = AutofacTool.Resolve <IUserService>(); if (userService == null) { basicReturn.SetFailureMsg("找不到用户服务"); return; } ReturnInfo <bool> perReInfo = userService.IsCurrUserPermission(menuAttr.Code, attr.Codes); if (perReInfo.Failure()) { basicReturn.FromBasic(perReInfo); return; } if (perReInfo.Data) { return; } else { basicReturn.SetCodeMsg(ErrCodeDefine.NOT_PERMISSION, "Sorry,您没有访问此功能权限"); } }
/// <summary> /// 执行 /// </summary> /// <param name="param">参数</param> /// <param name="paramIndex">参数索引位置</param> /// <returns>返回信息</returns> public BasicReturnInfo Exec(object[] param, byte paramIndex = 0) { BasicReturnInfo returnInfo = new BasicReturnInfo(); if (param[paramIndex] == null) { return(returnInfo); } System.Collections.IEnumerable list = param[paramIndex] as System.Collections.IEnumerable; int row = 1; foreach (var model in list) { if (model == null) { returnInfo.SetFailureMsg($"第{row}行:模型不能为null"); return(returnInfo); } returnInfo = modelComVali.Exec(new object[] { model }, 0); if (returnInfo.Failure()) { returnInfo.SetMsg($"第{row}行:{returnInfo.Msg}", $"第{row}行:{returnInfo.Desc}"); return(returnInfo); } row++; } return(returnInfo); }
/// <summary> /// 执行 /// </summary> /// <param name="param">参数</param> /// <param name="paramIndex">参数索引位置</param> /// <returns>返回信息</returns> public BasicReturnInfo Exec(object[] param, byte paramIndex = 0) { BasicReturnInfo returnInfo = new BasicReturnInfo(); int length = param.Length - paramIndex; for (byte i = paramIndex, row = 1; i < length; i++, row++) { object model = param[i]; if (model == null) { returnInfo.SetFailureMsg($"第{row}行:模型不能为null"); return(returnInfo); } returnInfo = modelComVali.Exec(param, i); if (returnInfo.Failure()) { returnInfo.SetMsg($"第{row}行:{returnInfo.Msg}", $"第{row}行:{returnInfo.Desc}"); return(returnInfo); } } return(returnInfo); }
/// <summary> /// 拦截 /// </summary> /// <param name="basicReturn">基本返回</param> /// <param name="invocation">拦截参数</param> /// <param name="attr">特性</param> /// <param name="isExecProceeded">是否已执行</param> protected override void Intercept(BasicReturnInfo basicReturn, IInvocation invocation, ValiAttribute attr, out bool isExecProceeded) { isExecProceeded = false; if (attr.Handlers.IsNullOrLength0()) { return; } for (int i = 0; i < attr.Handlers.Length; i++) { Type type = attr.Handlers[i]; IValiHandler vali = type.CreateInstance <IValiHandler>() as IValiHandler; if (vali == null) { basicReturn.SetFailureMsg($"{type.FullName}未实现IValiable接口"); return; } BasicReturnInfo reInfo = vali.Exec(invocation.Arguments, attr.Indexs[i]); if (basicReturn.Failure()) { basicReturn.FromBasic(reInfo); return; } } }
/// <summary> /// 执行 /// </summary> /// <param name="param">参数</param> /// <param name="paramIndex">参数索引位置</param> /// <returns>返回信息</returns> public BasicReturnInfo Exec(object[] param, byte paramIndex = 0) { BasicReturnInfo returnInfo = new BasicReturnInfo(); if (param[paramIndex] == null) { returnInfo.SetFailureMsg("ID不能为null"); return(returnInfo); } if (Convert.ToUInt32(param[paramIndex]) <= 0) { returnInfo.SetFailureMsg("ID必须大于0"); return(returnInfo); } return(returnInfo); }
/// <summary> /// 判断当前用户能否审核 /// </summary> /// <param name="workflowHandle">工作流处理</param> /// <param name="currUser">当前用户</param> /// <returns>当前用户能否审核</returns> public static BasicReturnInfo CanCurrUserAudit(WorkflowHandleInfo workflowHandle, BasicUserInfo currUser = null) { BasicReturnInfo returnInfo = new BasicReturnInfo(); var user = UserTool.GetCurrUser(currUser); if (user == null) { returnInfo.SetFailureMsg("您还未登录,请先登录系统"); return(returnInfo); } if (workflowHandle == null) { returnInfo.SetFailureMsg("找不到处理信息"); return(returnInfo); } if (workflowHandle.HandlerId != user.Id) { returnInfo.SetFailureMsg("Sorry,您不是此流程的处理者,无权限审核"); return(returnInfo); } if (workflowHandle.HandleStatus == HandleStatusEnum.EFFICACYED) { returnInfo.SetFailureMsg("Sorry,您的处理信息已无效"); return(returnInfo); } if (workflowHandle.HandleStatus == HandleStatusEnum.SENDED || workflowHandle.HandleStatus == HandleStatusEnum.RETURNED) { returnInfo.SetFailureMsg("Sorry,您的处理信息已处理,无需重复处理"); return(returnInfo); } return(returnInfo); }
/// <summary> /// 过滤返回值 /// </summary> /// <param name="invocation">拦截参数</param> /// <param name="ex"></param> /// <returns>是否已过滤</returns> private bool FilterReturnValue(IInvocation invocation, Exception ex) { if (invocation.Method.ReturnType.IsReturnType()) { if (ex == null) { BasicReturnInfo basicReturnInfo; if (invocation.ReturnValue != null) { basicReturnInfo = invocation.ReturnValue as BasicReturnInfo; } else { basicReturnInfo = invocation.Method.ReturnType.CreateInstance <BasicReturnInfo>(); invocation.ReturnValue = basicReturnInfo; } if (string.IsNullOrWhiteSpace(basicReturnInfo.Msg)) { if (basicReturnInfo.Success()) { var msg = Localize != null?Localize.Get(CommonCodeDefine.OPER_SUCCESS_KEY, "操作成功") : "操作成功"; basicReturnInfo.SetSuccessMsg(msg); } else { var msg = Localize != null?Localize.Get(CommonCodeDefine.OPER_FAILURE_KEY, "操作失败") : "操作失败"; basicReturnInfo.SetSuccessMsg(msg); } } } else { var msg = Localize != null?Localize.Get(CommonCodeDefine.SYSTEM_EXCEPTION_KEY, "操作异常,请联系管理员") : "操作异常,请联系管理员"; BasicReturnInfo basicReturnInfo = invocation.Method.ReturnType.CreateInstance <BasicReturnInfo>(); basicReturnInfo.SetFailureMsg(msg, ex.Message, ex); invocation.ReturnValue = basicReturnInfo; } return(true); } else { return(false); } }
/// <summary> /// 拦截操作 /// </summary> /// <param name="invocation">拦截参数</param> /// <param name="attr">特性</param> /// <param name="isExecProceeded">是否已执行</param> /// <returns>基本返回信息</returns> protected override BasicReturnInfo InterceptOperation(IInvocation invocation, out bool isExecProceeded) { isExecProceeded = false; BasicReturnInfo basicReturn = new BasicReturnInfo(); if (invocation.Arguments.IsNullOrLength0()) { return(basicReturn); } ParameterInfo[] parameters = invocation.Method.GetParameters(); for (var i = 0; i < parameters.Length; i++) { ParameterInfo p = parameters[i]; IEnumerable <Attribute> atts = p.GetCustomAttributes(); if (atts == null) { continue; } DisplayName2Attribute paramDisplayNameAttr = p.GetCustomAttribute <DisplayName2Attribute>(); string displayName = paramDisplayNameAttr == null ? p.Name : paramDisplayNameAttr.Name; foreach (Attribute a in atts) { if (a is ValidationAttribute) { ValidationAttribute v = a as ValidationAttribute; Type type = v.GetType(); if (dicValiParams.ContainsKey(type)) { string errMsg = dicValiParams[type].Exec(invocation.GetArgumentValue(i), v, displayName); if (string.IsNullOrWhiteSpace(errMsg)) { continue; } basicReturn.SetFailureMsg(errMsg); return(basicReturn); } } } } return(basicReturn); }
/// <summary> /// 捕获日志执行 /// 当发生异常时,会记录异常日志,同时触发异常回调 /// </summary> /// <typeparam name="ReturnT">返回类型</typeparam> /// <param name="func">执行核心</param> /// <param name="exceptionCallback">异常回调</param> /// <param name="eventId">事件ID</param> /// <param name="logTags">日志标签</param> /// <returns>返回类型</returns> public ReturnT TryLogExec <ReturnT>(Func <ReturnT> func, Func <BasicReturnInfo, ReturnT> exceptionCallback = null, string eventId = null, params string[] logTags) { try { return(func()); } catch (Exception ex) { Log.ErrorAsync(ex.Message, ex, source: "LogBusiness", eventId: eventId, tags: logTags); var re = new BasicReturnInfo(); var msg = Localize != null?Localize.Get(CommonCodeDefine.OPER_FAILURE_KEY, "操作失败") : "操作失败"; re.SetFailureMsg("操作失败", ex.Message, ex); return(exceptionCallback(re)); } }
/// <summary> /// 过滤返回值 /// </summary> /// <param name="invocation">拦截参数</param> /// <param name="ex"></param> /// <returns>是否已过滤</returns> private bool FilterReturnValue(IInvocation invocation, Exception ex) { if (invocation.Method.ReturnType.IsReturnType()) { if (ex == null) { BasicReturnInfo basicReturnInfo; if (invocation.ReturnValue != null) { basicReturnInfo = invocation.ReturnValue as BasicReturnInfo; } else { basicReturnInfo = invocation.Method.ReturnType.CreateInstance <BasicReturnInfo>(); invocation.ReturnValue = basicReturnInfo; } if (string.IsNullOrWhiteSpace(basicReturnInfo.Msg)) { if (basicReturnInfo.Success()) { basicReturnInfo.SetSuccessMsg("操作成功"); } else { basicReturnInfo.SetSuccessMsg("操作失败"); } } } else { BasicReturnInfo basicReturnInfo = invocation.Method.ReturnType.CreateInstance <BasicReturnInfo>(); basicReturnInfo.SetFailureMsg("操作异常,请联系管理员", ex.Message); invocation.ReturnValue = basicReturnInfo; } return(true); } else { return(false); } }
/// <summary> /// 验证 /// </summary> /// <param name="model">模型</param> /// <param name="property">属性</param> /// <param name="value">值</param> /// <returns>返回信息</returns> public BasicReturnInfo Vali(object model, PropertyInfo property, object value) { BasicReturnInfo returnInfo = new BasicReturnInfo(); ValiAttrT valiAttr = property.GetCustomAttribute <ValiAttrT>(); if (valiAttr == null) { return(returnInfo); } DisplayNameAttribute displayName = property.GetCustomAttribute <DisplayNameAttribute>(); string name = displayName != null ? displayName.DisplayName : property.Name; string errMsg = ExecVali(model, value, name, valiAttr); if (string.IsNullOrWhiteSpace(errMsg)) { return(returnInfo); } returnInfo.SetFailureMsg(errMsg); return(returnInfo); }
/// <summary> /// 读取其他配置 /// </summary> /// <param name="workflowDefine">工作流定义</param> /// <param name="connectionId">连接ID</param> /// <param name="comData">通用数据</param> private BasicReturnInfo ReaderOtherConfig(WorkflowDefineInfo workflowDefine, string connectionId, CommonUseData comData = null) { BasicReturnInfo basicReturn = new BasicReturnInfo(); if (workflowDefine == null) { basicReturn.SetFailureMsg("找不到工作流定义信息"); return(basicReturn); } #region 查找流程/表单/流程关卡 ReturnInfo <FlowInfo> reFlow = FlowService.Find(workflowDefine.FlowId, connectionId: connectionId, comData: comData); if (reFlow.Failure()) { basicReturn.FromBasic(reFlow); return(basicReturn); } if (reFlow.Data == null) { basicReturn.SetFailureMsg("找不到工作流的流程信息"); return(basicReturn); } ReturnInfo <FormInfo> reForm = FormService.Find(workflowDefine.FormId, connectionId: connectionId, comData: comData); workflowDefine.Flow = reFlow.Data; if (reForm.Failure()) { basicReturn.FromBasic(reForm); return(basicReturn); } if (reForm.Data == null) { basicReturn.SetFailureMsg("找不到工作流的表单信息"); return(basicReturn); } workflowDefine.Form = reForm.Data; ReturnInfo <IList <FlowCensorshipInfo> > reFlowCensorships = FlowCensorshipService.QueryByFlowId(workflowDefine.FlowId, connectionId: connectionId, comData: comData); if (reFlowCensorships.Failure()) { basicReturn.FromBasic(reFlowCensorships); return(basicReturn); } if (reFlowCensorships.Data.IsNullOrCount0()) { basicReturn.SetFailureMsg("找不到工作流的流程关卡信息"); return(basicReturn); } workflowDefine.Flow.FlowCensorships = reFlowCensorships.Data.ToArray(); // 构造流程关卡ID数组 int[] flowCensorshipIds = new int[workflowDefine.Flow.FlowCensorships.Length]; IList <int> stFlowCensorshipIds = new List <int>(); for (var i = 0; i < flowCensorshipIds.Length; i++) { var f = workflowDefine.Flow.FlowCensorships[i]; flowCensorshipIds[i] = f.Id; if (f.OwnerCensorshipType == CensorshipTypeEnum.STANDARD) { stFlowCensorshipIds.Add(f.OwnerCensorshipId); } } #endregion #region 查找送件/退件路线/标准关卡 IList <StandardCensorshipInfo> standardCensorships = null; // 标准关卡 if (!stFlowCensorshipIds.IsNullOrCount0()) { ReturnInfo <IList <StandardCensorshipInfo> > reStand = StandardCensorshipService.Find(stFlowCensorshipIds.ToArray(), connectionId: connectionId, comData: comData); if (reStand.Failure()) { basicReturn.FromBasic(reStand); return(basicReturn); } if (reStand.Data.IsNullOrCount0()) { basicReturn.SetFailureMsg("找不到标准关卡信息"); return(basicReturn); } standardCensorships = reStand.Data; } ReturnInfo <IList <SendFlowRouteInfo> > reSend = SendFlowRouteService.QueryByFlowCensorshipIds(flowCensorshipIds, connectionId: connectionId, comData: comData); if (reSend.Failure()) { basicReturn.FromBasic(reSend); return(basicReturn); } if (reSend.Data.IsNullOrCount0()) { basicReturn.SetFailureMsg("找不到工作流的送件路线信息"); } ReturnInfo <IList <ReturnFlowRouteInfo> > reReturn = ReturnFlowRouteService.QueryByFlowCensorshipIds(flowCensorshipIds, connectionId: connectionId, comData: comData); if (reReturn.Failure()) { basicReturn.FromBasic(reReturn); return(basicReturn); } foreach (var f in workflowDefine.Flow.FlowCensorships) { switch (f.OwnerCensorshipType) { case CensorshipTypeEnum.STANDARD: IList <StandardCensorshipInfo> stdList = new List <StandardCensorshipInfo>(); foreach (var s in standardCensorships) { if (f.OwnerCensorshipId == s.Id) { stdList.Add(s); } } if (stdList.Count == 0) { basicReturn.SetFailureMsg($"找不到归属ID为{f.OwnerCensorshipId}的标准关卡信息"); return(basicReturn); } f.StandardCensorships = stdList.ToArray(); break; } IList <SendFlowRouteInfo> sendRotes = new List <SendFlowRouteInfo>(); foreach (var send in reSend.Data) { if (f.Id == send.FlowCensorshipId) { sendRotes.Add(send); } } if (!sendRotes.IsNullOrCount0()) { f.SendFlowRoutes = sendRotes.ToArray(); } if (!reReturn.Data.IsNullOrCount0()) { IList <ReturnFlowRouteInfo> returnRotes = new List <ReturnFlowRouteInfo>(); foreach (var re in reReturn.Data) { if (f.Id == re.FlowCensorshipId) { returnRotes.Add(re); } } if (!returnRotes.IsNullOrCount0()) { f.ReturnFlowRoutes = returnRotes.ToArray(); } } } #endregion return(basicReturn); }
/// <summary> /// 执行 /// </summary> /// <param name="context">http上下文</param> /// <returns>任务</returns> public async Task InvokeAsync(HttpContext context) { var path = context.Request.Path.Value.ToLower(); if (path.StartsWith(options.PfxApiPath)) { var routeValue = context.Request.RouteValues; var routes = routeValue.GetControllerAction(); if (routes.IsNullOrLength0()) { await next(context); return; } var routePermisses = reader.Reader(); if (routePermisses.IsNullOrLength0()) { await next(context); return; } var controllerConfig = routePermisses.Where(p => p.Controller == routes[0]).FirstOrDefault(); if (controllerConfig == null) { await next(context); return; } if (controllerConfig.Disabled) { var tempReturn = new BasicReturnInfo(); tempReturn.SetFailureMsg(localize.Get(CommonCodeDefine.DISABLED_ACCESS_CULTURE_KEY, "此功能已禁用")); await WriteContent(context, tempReturn); return; } if (controllerConfig.Actions.IsNullOrLength0()) { await next(context); return; } var actionConfig = controllerConfig.Actions.Where(p => p.Action == routes[1]).FirstOrDefault(); if (actionConfig == null) { await next(context); return; } if (actionConfig.Disabled) { var tempReturn = new BasicReturnInfo(); tempReturn.SetFailureMsg(localize.Get(CommonCodeDefine.DISABLED_ACCESS_CULTURE_KEY, "此功能已禁用")); await WriteContent(context, tempReturn); return; } var basicReturn = new BasicReturnInfo(); var isPer = IsHavePermission(context, controllerConfig, actionConfig, basicReturn); if (basicReturn.Failure()) { await WriteContent(context, basicReturn); return; } if (isPer) { await next(context); } else { await NotPermissionHandle(context); } } else { await next(context); } }
/// <summary> /// 拦截 /// </summary> /// <param name="basicReturn">基本返回</param> /// <param name="invocation">拦截参数</param> /// <param name="attr">特性</param> /// <param name="isExecProceeded">是否已执行</param> protected override void Intercept(BasicReturnInfo basicReturn, IInvocation invocation, TransactionAttribute attr, out bool isExecProceeded) { isExecProceeded = true; BasicReturnInfo returnInfo = new BasicReturnInfo(); object connId = null; if (attr.ConnectionIdIndex == -1) { connId = invocation.GetArgumentValue(attr.ConnectionIdIndex); } IGetObject <IPersistenceConnection> getPerConn = AutofacTool.Resolve(invocation.TargetType) as IGetObject <IPersistenceConnection>; if (getPerConn == null) { basicReturn.SetFailureMsg("未实现IGetObject<IPersistenceConnection>接口"); return; } IPersistenceConnection perConn = getPerConn.Get(); string connectionId = null; // 当有连接ID传过来,判断是否存在该连接事务,存在则不开启新事务 if (connId != null) { string connIdStr = connId.ToString(); if (perConn.GetDbTransaction(connIdStr) != null) { invocation.Proceed(); return; } connectionId = connIdStr; } else { connectionId = perConn.NewConnectionId(); } IDbTransaction dbTransaction = null; try { dbTransaction = perConn.BeginTransaction(connectionId, attr); invocation.SetArgumentValue(attr.ConnectionIdIndex, connectionId); invocation.Proceed(); // 如果返回值为失败标识,也回滚 Type returnType = invocation.Method.ReturnType; if (invocation.Method.ReturnType.IsReturnType()) { BasicReturnInfo basicReturnInfo = invocation.ReturnValue as BasicReturnInfo; if (basicReturnInfo.Failure()) { dbTransaction.Rollback(); return; } } dbTransaction.Commit(); } catch (Exception ex) { if (dbTransaction != null) { dbTransaction.Rollback(); } throw new Exception(ex.Message, ex); } finally { perConn.Release(connectionId); } }
/// <summary> /// 接收消息 /// </summary> /// <param name="receiveMessageFun">接收消息回调</param> public void Receive(Func <byte[], byte[]> receiveMessageFun) { channel.QueueDeclare(queue: amqpQueue.Queue.Name, durable: amqpQueue.Persistent, exclusive: false, autoDelete: amqpQueue.Queue.AutoDelQueue, arguments: null); if (amqpQueue.Queue.Qos != null) { channel.BasicQos(0, amqpQueue.Queue.Qos.GetValueOrDefault(), false); } channel.QueueBind(amqpQueue.Queue.Name, amqpQueue.ExchangeName, amqpQueue.Queue.Name); var consumer = new EventingBasicConsumer(channel); channel.BasicConsume(queue: amqpQueue.Queue.Name, autoAck: false, consumer: consumer); consumer.Received += (model, ea) => { // 错误返回信息 BasicReturnInfo errorReturn = null; // 返回给客户端的数据 byte[] outData = null; // 关联ID string correlationId = null; IBasicProperties props = null; IBasicProperties replyProps = null; try { props = ea.BasicProperties; replyProps = channel.CreateBasicProperties(); replyProps.CorrelationId = props.CorrelationId; correlationId = props.CorrelationId; byte[] inData = ea.Body.IsEmpty ? null : ea.Body.ToArray(); try { outData = receiveMessageFun(inData); } catch (Exception ex) { var busEx = AmqpUtil.BuilderBusinessException(ex, null, amqpQueue, log, ex.Message); ExceptionHandle.Handle(busEx); log.ErrorAsync("RpcServer回调业务处理出现异常", ex, typeof(RabbitRpcServer).Name, correlationId); errorReturn = new BasicReturnInfo(); errorReturn.SetFailureMsg("业务处理出现异常", ex.Message); outData = Encoding.UTF8.GetBytes(JsonUtil.SerializeIgnoreNull(errorReturn)); } } catch (Exception ex) { log.ErrorAsync("RpcServer接收消息处理出现异常", ex, typeof(RabbitRpcServer).Name, correlationId); errorReturn = new BasicReturnInfo(); errorReturn.SetFailureMsg("RpcServer接收消息处理出现异常", ex.Message); outData = Encoding.UTF8.GetBytes(JsonUtil.SerializeIgnoreNull(errorReturn)); } finally { if (props != null && replyProps != null) { channel.BasicPublish(exchange: amqpQueue.ExchangeName, routingKey: props.ReplyTo, basicProperties: replyProps, body: outData); channel.BasicAck(deliveryTag: ea.DeliveryTag, multiple: false); } } }; }
/// <summary> /// 拦截 /// </summary> /// <param name="basicReturn">基本返回</param> /// <param name="invocation">拦截参数</param> /// <param name="attr">特性</param> /// <param name="isExecProceeded">是否已执行</param> protected override void Intercept(BasicReturnInfo basicReturn, IInvocation invocation, DisabledAttribute attr, out bool isExecProceeded) { isExecProceeded = false; basicReturn.SetFailureMsg("Sorry,此功能禁止访问"); }