diff --git a/backend/src/main/java/io/metersphere/api/controller/APITestController.java b/backend/src/main/java/io/metersphere/api/controller/APITestController.java index 6ac534febb..28cbd6e764 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -127,10 +127,4 @@ public class APITestController { public List listSchedule(@RequestBody QueryScheduleRequest request) { return apiTestService.listSchedule(request); } - - @GetMapping("/license/valid") - public LicenseDTO valid() { - return apiTestService.validateLicense(); - } - } diff --git a/backend/src/main/java/io/metersphere/api/service/APITestService.java b/backend/src/main/java/io/metersphere/api/service/APITestService.java index 83b33c5b37..bedba60a9d 100644 --- a/backend/src/main/java/io/metersphere/api/service/APITestService.java +++ b/backend/src/main/java/io/metersphere/api/service/APITestService.java @@ -437,13 +437,4 @@ public class APITestService { quotaService.checkAPITestQuota(); } } - - public LicenseDTO validateLicense() { - LicenseService licenseService = CommonBeanFactory.getBean(LicenseService.class); - if (licenseService != null) { - return licenseService.valid(); - } - return null; - } - } diff --git a/backend/src/main/java/io/metersphere/controller/LoginController.java b/backend/src/main/java/io/metersphere/controller/LoginController.java index 8452a51810..e0a2e015b1 100644 --- a/backend/src/main/java/io/metersphere/controller/LoginController.java +++ b/backend/src/main/java/io/metersphere/controller/LoginController.java @@ -5,6 +5,7 @@ import io.metersphere.commons.constants.UserSource; import io.metersphere.commons.user.SessionUser; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.controller.request.LoginRequest; +import io.metersphere.dto.LicenseDTO; import io.metersphere.service.UserService; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; @@ -67,4 +68,9 @@ public class LoginController { return userService.getDefaultLanguage(); } + @GetMapping("/api/license/valid") + public LicenseDTO valid() { + return userService.validateLicense(); + } + } diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index ef8e264e57..e72a0b56d0 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -10,6 +10,7 @@ import io.metersphere.commons.constants.UserStatus; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.user.SessionUser; import io.metersphere.commons.utils.CodingUtil; +import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.controller.ResultHolder; import io.metersphere.controller.request.LoginRequest; @@ -19,6 +20,7 @@ import io.metersphere.controller.request.member.QueryMemberRequest; import io.metersphere.controller.request.member.UserRequest; import io.metersphere.controller.request.organization.AddOrgMemberRequest; import io.metersphere.controller.request.organization.QueryOrgMemberRequest; +import io.metersphere.dto.LicenseDTO; import io.metersphere.dto.UserDTO; import io.metersphere.dto.UserRoleDTO; import io.metersphere.i18n.Translator; @@ -589,4 +591,12 @@ public class UserService { public List searchUser(String condition) { return extUserMapper.searchUser(condition); } + + public LicenseDTO validateLicense() { + LicenseService licenseService = CommonBeanFactory.getBean(LicenseService.class); + if (licenseService != null) { + return licenseService.valid(); + } + return null; + } } diff --git a/frontend/src/business/App.vue b/frontend/src/business/App.vue index 266b73605e..595f1ff258 100644 --- a/frontend/src/business/App.vue +++ b/frontend/src/business/App.vue @@ -1,15 +1,11 @@