Commit e9250468 authored by jiawei's avatar jiawei
parents d60896b0 54bdac3f
...@@ -662,8 +662,17 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -662,8 +662,17 @@ public class ChinaMobileRestApiController extends BaseController {
Map map = new HashMap(); Map map = new HashMap();
if (StringUtils.isNotBlank(versionNo)) { if (StringUtils.isNotBlank(versionNo)) {
if (Long.parseLong(versionNo) >= Long.parseLong(current.getAppVersion())) { final String prefix = StringUtils.substring(versionNo, 0, StringUtils.indexOf(versionNo, "."));
final String suffix = StringUtils.substring(versionNo, StringUtils.indexOf(versionNo, ".")).replaceAll("\\.", "");
String currAppVersion = current.getAppVersion();
final String prefix1 = StringUtils.substring(currAppVersion, 0, StringUtils.indexOf(currAppVersion, "."));
final String suffix1 = StringUtils.substring(currAppVersion, StringUtils.indexOf(currAppVersion, ".")).replaceAll("\\.", "");
if (Double.parseDouble(prefix + "." + suffix) >= Double.parseDouble(prefix1 + "." + suffix1)) {
map.put("isLatest", true); map.put("isLatest", true);
} else {
map.put("isLatest", false);
} }
} else { } else {
map.put("isLatest", false); map.put("isLatest", false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment