Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wangjiahao
2022-05-25 10:54:16 +08:00
5 changed files with 23 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ import io.dataease.commons.utils.LogUtil;
import io.dataease.listener.util.CacheUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
@@ -25,6 +26,10 @@ public class AboutService {
@Resource
private DefaultLicenseService defaultLicenseService;
@Value("${version}")
private String version;
public F2CLicenseResponse updateLicense(String licenseKey) {
F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.updateLicense(product, licenseKey);
Optional.ofNullable(f2CLicenseResponse).ifPresent(resp -> {
@@ -62,8 +67,7 @@ public class AboutService {
return version;
}
}
String property = CommonBeanFactory.getBean(Environment.class).getProperty("cmp.version");
return Optional.ofNullable(property).orElse("V1.0");
return Optional.ofNullable(version).orElse("V1.0");
} catch (Exception e) {
LogUtil.error("failed to get build version.", e);
}