forked from github/dataease
Merge branch 'dev' of github.com:dataease/dataease into dev
This commit is contained in:
commit
75d223f417
@ -2,6 +2,7 @@ package io.dataease.commons.condition;
|
||||
|
||||
import io.dataease.commons.license.DefaultLicenseService;
|
||||
import io.dataease.commons.license.F2CLicenseResponse;
|
||||
import io.dataease.commons.utils.CommonBeanFactory;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.context.annotation.Condition;
|
||||
import org.springframework.context.annotation.ConditionContext;
|
||||
@ -15,7 +16,10 @@ public class LicStatusCondition implements Condition {
|
||||
public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
|
||||
// BeanDefinitionRegistry registry = conditionContext.getRegistry();
|
||||
|
||||
DefaultLicenseService defaultLicenseService = conditionContext.getBeanFactory().getBean(DefaultLicenseService.class);
|
||||
// DefaultLicenseService defaultLicenseService = conditionContext.getBeanFactory().getBean(DefaultLicenseService.class);
|
||||
|
||||
DefaultLicenseService defaultLicenseService = CommonBeanFactory.getBean(DefaultLicenseService.class);
|
||||
|
||||
/*if (null == defaultLicenseService) {
|
||||
registry.registerBeanDefinition();
|
||||
}*/
|
||||
|
@ -3,6 +3,7 @@ package io.dataease.commons.license;
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.base.domain.License;
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -31,6 +32,7 @@ public class DefaultLicenseService {
|
||||
command.add(licenseKey);
|
||||
try{
|
||||
execCommand(result, command);
|
||||
LogUtil.info("read lic content is : " + result.toString());
|
||||
F2CLicenseResponse f2CLicenseResponse = new Gson().fromJson(result.toString(), F2CLicenseResponse.class);
|
||||
if(f2CLicenseResponse.getStatus() != F2CLicenseResponse.Status.valid){
|
||||
return f2CLicenseResponse;
|
||||
@ -43,6 +45,7 @@ public class DefaultLicenseService {
|
||||
}
|
||||
return f2CLicenseResponse;
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return F2CLicenseResponse.invalid(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user