using AspectInjector.Broker;
using DispenserCommon.Utils;
using Serilog;
namespace DispenserCommon.Aop;
///
/// 用于捕获方法执行过程中的异常,并弹窗
///
[Aspect(Scope.Global)]
[Injection(typeof(AlertWhenException))]
public class AlertWhenException(string title = "异常提示", string contentTitle = "") : Attribute
{
public AlertWhenException() : this("异常提示")
{
}
///
/// 通过AOP实现方法执行前后的时间消耗
///
///
///
///
///
///
///
[Advice(Kind.Around)]
public object Around([Argument(Source.Name)] string name,
[Argument(Source.Arguments)] object[] args,
[Argument(Source.Type)] Type hostType,
[Argument(Source.Target)] Func