From dd2ae6578673651712134fd1867dca514cfec61f Mon Sep 17 00:00:00 2001 From: chenzhangyue <chenzhangyue01@weidian.com> Date: 星期四, 10 八月 2023 20:00:43 +0800 Subject: [PATCH] 修复代理访问跨域问题,和ScheduledFuture取消任务时指令重排异常,不结束正在运行的任务。防止 Command interrupted --- src/main/java/com/genersoft/iot/vmp/utils/SpringBeanFactory.java | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/utils/SpringBeanFactory.java b/src/main/java/com/genersoft/iot/vmp/utils/SpringBeanFactory.java index 3d2b2ba..5323875 100644 --- a/src/main/java/com/genersoft/iot/vmp/utils/SpringBeanFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/utils/SpringBeanFactory.java @@ -33,9 +33,11 @@ /** * 鑾峰彇瀵硅薄 杩欓噷閲嶅啓浜哹ean鏂规硶锛岃捣涓昏浣滅敤 */ - public static Object getBean(String beanId) throws BeansException { - if (applicationContext == null) return null; - return applicationContext.getBean(beanId); + public static <T> T getBean(String beanId) throws BeansException { + if (applicationContext == null) { + return null; + } + return (T) applicationContext.getBean(beanId); } /** -- Gitblit v1.8.0