|
@@ -4,7 +4,6 @@ import com.qmth.boot.core.security.annotation.AuthorizationComponent;
|
|
|
import com.qmth.boot.core.security.service.AuthorizationService;
|
|
|
import com.qmth.boot.core.security.service.impl.BaseAuthorizationSupport;
|
|
|
import com.qmth.boot.tools.signature.SignatureType;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.context.ApplicationListener;
|
|
|
import org.springframework.context.event.ContextRefreshedEvent;
|
|
@@ -43,12 +42,14 @@ public class SecurityContextListener implements ApplicationListener<ContextRefre
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void register(AuthorizationService bean, String prefix, SignatureType type) {
|
|
|
- if (StringUtils.isNotBlank(prefix)) {
|
|
|
- if (type != null) {
|
|
|
- baseAuthorizationSupport.getServiceContainer().setPrefix(prefix, type, bean);
|
|
|
- } else {
|
|
|
- baseAuthorizationSupport.getServiceContainer().setPrefix(prefix, bean);
|
|
|
+ private void register(AuthorizationService bean, String[] prefixs, SignatureType type) {
|
|
|
+ if (prefixs.length > 0) {
|
|
|
+ for (String prefix : prefixs) {
|
|
|
+ if (type != null) {
|
|
|
+ baseAuthorizationSupport.getServiceContainer().setPrefix(prefix, type, bean);
|
|
|
+ } else {
|
|
|
+ baseAuthorizationSupport.getServiceContainer().setPrefix(prefix, bean);
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
if (type != null) {
|