forked from github/dataease
fix: 关于页面中版本号错误
This commit is contained in:
parent
2e24db7aa1
commit
ab111a9d32
@ -9,6 +9,7 @@ import io.dataease.commons.utils.LogUtil;
|
|||||||
import io.dataease.listener.util.CacheUtils;
|
import io.dataease.listener.util.CacheUtils;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -25,6 +26,10 @@ public class AboutService {
|
|||||||
@Resource
|
@Resource
|
||||||
private DefaultLicenseService defaultLicenseService;
|
private DefaultLicenseService defaultLicenseService;
|
||||||
|
|
||||||
|
|
||||||
|
@Value("${version}")
|
||||||
|
private String version;
|
||||||
|
|
||||||
public F2CLicenseResponse updateLicense(String licenseKey) {
|
public F2CLicenseResponse updateLicense(String licenseKey) {
|
||||||
F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.updateLicense(product, licenseKey);
|
F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.updateLicense(product, licenseKey);
|
||||||
Optional.ofNullable(f2CLicenseResponse).ifPresent(resp -> {
|
Optional.ofNullable(f2CLicenseResponse).ifPresent(resp -> {
|
||||||
@ -62,8 +67,7 @@ public class AboutService {
|
|||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String property = CommonBeanFactory.getBean(Environment.class).getProperty("cmp.version");
|
return Optional.ofNullable(version).orElse("V1.0");
|
||||||
return Optional.ofNullable(property).orElse("V1.0");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogUtil.error("failed to get build version.", e);
|
LogUtil.error("failed to get build version.", e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user