提交 a3bc670b 编写于 作者: C chenjianxing

fix: 修改sso名称

上级 60ed8a05
......@@ -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;
......
......@@ -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();
}
......
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();
}
......
......@@ -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 => {
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册