wangliang 2 anos atrás
pai
commit
895bcd23b6

+ 5 - 4
themis-admin/src/main/java/com/qmth/themis/admin/api/DownloadController.java

@@ -56,11 +56,12 @@ public class DownloadController {
 
             TBOrgDownloadBean tbOrgDownloadBean = GsonUtil.fromJson(GsonUtil.toJson(tbOrg), TBOrgDownloadBean.class);
             TBClientVersion tbClientVersion = tbClientVersionService.getLastUploadClientVersion(tbOrg.getId());
-            if (Objects.nonNull(tbClientVersion)) {
-                VersionBean v = new VersionBean(tbClientVersion.getName(), tbClientVersion.getValue(), tbClientVersion.getUrl());
-                tbOrgDownloadBean.setVersion(v);
-                tbOrgDownloadBean.setPackagePath(v.getUrl());
+            if (Objects.isNull(tbClientVersion)) {
+                tbClientVersion = tbClientVersionService.getMaxClientVersion();
             }
+            VersionBean v = new VersionBean(tbClientVersion.getName(), tbClientVersion.getValue(), tbClientVersion.getUrl());
+            tbOrgDownloadBean.setVersion(v);
+            tbOrgDownloadBean.setPackagePath(v.getUrl());
             return ResultUtil.ok(tbOrgDownloadBean);
         } else {
             throw new BusinessException("超级管理员无需下载");