diff --git a/backend/src/main/java/io/metersphere/commons/constants/OssMode.java b/backend/src/main/java/io/metersphere/commons/constants/SsoMode.java similarity index 72% rename from backend/src/main/java/io/metersphere/commons/constants/OssMode.java rename to backend/src/main/java/io/metersphere/commons/constants/SsoMode.java index aeb142a55b..beeed6ae3b 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/OssMode.java +++ b/backend/src/main/java/io/metersphere/commons/constants/SsoMode.java @@ -1,5 +1,5 @@ package io.metersphere.commons.constants; -public enum OssMode { +public enum SsoMode { CAS,LOCAL } diff --git a/backend/src/main/java/io/metersphere/config/ShiroConfig.java b/backend/src/main/java/io/metersphere/config/ShiroConfig.java index a6dc567cef..ab1e55c60c 100644 --- a/backend/src/main/java/io/metersphere/config/ShiroConfig.java +++ b/backend/src/main/java/io/metersphere/config/ShiroConfig.java @@ -29,7 +29,7 @@ import java.util.Map; import java.util.Objects; @Configuration -@ConditionalOnProperty(prefix="oss",name = "mode", havingValue = "local", matchIfMissing = true) +@ConditionalOnProperty(prefix="sso",name = "mode", havingValue = "local", matchIfMissing = true) public class ShiroConfig implements EnvironmentAware { private Environment env; diff --git a/backend/src/main/java/io/metersphere/controller/IndexController.java b/backend/src/main/java/io/metersphere/controller/IndexController.java index 8bbd67e76d..29503b9c53 100644 --- a/backend/src/main/java/io/metersphere/controller/IndexController.java +++ b/backend/src/main/java/io/metersphere/controller/IndexController.java @@ -24,12 +24,12 @@ public class IndexController { } } - @GetMapping(value = "/oss/login") + @GetMapping(value = "/sso/login") public String ossLogin() { return "redirect:/"; } - @GetMapping(value = "/oss/logout") + @GetMapping(value = "/sso/logout") public void ossLogout() { SecurityUtils.getSubject().logout(); } diff --git a/backend/src/main/java/io/metersphere/controller/LoginController.java b/backend/src/main/java/io/metersphere/controller/LoginController.java index 9b2b8987d9..8452a51810 100644 --- a/backend/src/main/java/io/metersphere/controller/LoginController.java +++ b/backend/src/main/java/io/metersphere/controller/LoginController.java @@ -1,6 +1,6 @@ package io.metersphere.controller; -import io.metersphere.commons.constants.OssMode; +import io.metersphere.commons.constants.SsoMode; import io.metersphere.commons.constants.UserSource; import io.metersphere.commons.user.SessionUser; import io.metersphere.commons.utils.SessionUtils; @@ -32,9 +32,9 @@ public class LoginController { } return ResultHolder.success(user); } - String ossMode = env.getProperty("oss.mode"); - if (ossMode != null && StringUtils.equalsIgnoreCase(OssMode.CAS.name(), ossMode)) { - return ResultHolder.error("oss"); + String ssoMode = env.getProperty("sso.mode"); + if (ssoMode != null && StringUtils.equalsIgnoreCase(SsoMode.CAS.name(), ssoMode)) { + return ResultHolder.error("sso"); } return ResultHolder.error(""); } @@ -52,9 +52,9 @@ public class LoginController { @GetMapping(value = "/signout") public ResultHolder logout() { - String ossMode = env.getProperty("oss.mode"); - if (ossMode != null && StringUtils.equalsIgnoreCase(OssMode.CAS.name(), ossMode)) { - return ResultHolder.error("oss"); + String ssoMode = env.getProperty("sso.mode"); + if (ssoMode != null && StringUtils.equalsIgnoreCase(SsoMode.CAS.name(), ssoMode)) { + return ResultHolder.error("sso"); } else { SecurityUtils.getSubject().logout(); } diff --git a/frontend/src/business/components/common/head/HeaderUser.vue b/frontend/src/business/components/common/head/HeaderUser.vue index 02a8cd6a65..10f38530fe 100644 --- a/frontend/src/business/components/common/head/HeaderUser.vue +++ b/frontend/src/business/components/common/head/HeaderUser.vue @@ -41,9 +41,9 @@ localStorage.clear(); window.location.href = "/login"; } else { - if (response.data.message === 'oss') { + if (response.data.message === 'sso') { localStorage.clear(); - window.location.href = "/oss/logout" + window.location.href = "/sso/logout" } } }).catch(error => { diff --git a/frontend/src/login/Login.vue b/frontend/src/login/Login.vue index 981925357c..d188be5973 100644 --- a/frontend/src/login/Login.vue +++ b/frontend/src/login/Login.vue @@ -88,8 +88,8 @@ beforeCreate() { this.$get("/isLogin").then(response => { if (!response.data.success) { - if (response.data.message === 'oss') { - window.location.href = "/oss/login" + if (response.data.message === 'sso') { + window.location.href = "/sso/login" } else { this.ready = true; }