zouxuan 3 years ago
parent
commit
bbd1f82845

+ 2 - 0
mec-im/src/main/java/com/ym/interceptor/TenantInterceptor.java

@@ -3,6 +3,7 @@ package com.ym.interceptor;
 import com.ym.mec.biz.service.TenantInfoService;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Component;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
 
@@ -13,6 +14,7 @@ import javax.servlet.http.HttpServletResponse;
 public class TenantInterceptor extends HandlerInterceptorAdapter {
 
 	@Autowired
+	@Lazy
 	private TenantInfoService tenantInfoService;
 
 	@Override

+ 2 - 0
mec-student/src/main/java/com/ym/mec/student/interceptor/TenantInterceptor.java

@@ -3,6 +3,7 @@ package com.ym.mec.student.interceptor;
 import com.ym.mec.biz.service.TenantInfoService;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Component;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
 
@@ -13,6 +14,7 @@ import javax.servlet.http.HttpServletResponse;
 public class TenantInterceptor extends HandlerInterceptorAdapter {
 
 	@Autowired
+	@Lazy
 	private TenantInfoService tenantInfoService;
 
 	@Override