Commit 145f86f8 authored by liqin's avatar liqin 💬

bug fixed

parent 8f0d0e9b
...@@ -713,14 +713,11 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -713,14 +713,11 @@ public class ChinaMobileRestApiController extends BaseController {
Map map = new HashMap(); Map map = new HashMap();
if (StringUtils.isNotBlank(versionNo)) { if (StringUtils.isNotBlank(versionNo)) {
final String prefix = StringUtils.substring(versionNo, 0, StringUtils.indexOf(versionNo, ".")); final String[] versionNoArray = StringUtils.split(versionNo, ".");
final String suffix = StringUtils.substring(versionNo, StringUtils.indexOf(versionNo, ".")).replaceAll("\\.", ""); final String[] currentVersionNoArray = StringUtils.split(current.getAppVersion(), ".");
if (Integer.parseInt(versionNoArray[0]) >= Integer.parseInt(currentVersionNoArray[0])) {
String currAppVersion = current.getAppVersion(); if (Integer.parseInt(versionNoArray[1]) >= Integer.parseInt(currentVersionNoArray[1])) {
final String prefix1 = StringUtils.substring(currAppVersion, 0, StringUtils.indexOf(currAppVersion, ".")); if (Integer.parseInt(versionNoArray[2]) >= Integer.parseInt(currentVersionNoArray[2])) {
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 { } else {
map.put("isLatest", false); map.put("isLatest", false);
...@@ -728,6 +725,12 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -728,6 +725,12 @@ public class ChinaMobileRestApiController extends BaseController {
} else { } else {
map.put("isLatest", false); map.put("isLatest", false);
} }
} else {
map.put("isLatest", false);
}
} else {
map.put("isLatest", false);
}
map.put("versionNo", current.getAppVersion()); map.put("versionNo", current.getAppVersion());
map.put("versionUrl", current.getApkUrl()); map.put("versionUrl", current.getApkUrl());
map.put("updateLog", current.getUpdateLog()); map.put("updateLog", current.getUpdateLog());
......
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