Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
3426a49c8c
|
@ -1,5 +1,5 @@
|
|||
package io.metersphere.commons.constants;
|
||||
|
||||
public enum UserSource {
|
||||
LOCAL, LDAP
|
||||
LOCAL, LDAP, CAS, OIDC
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ public class ShiroUtils {
|
|||
filterChainDefinitionMap.put("/authsource/list/allenable", "anon");
|
||||
filterChainDefinitionMap.put("/sso/signin", "anon");
|
||||
filterChainDefinitionMap.put("/sso/callback", "anon");
|
||||
|
||||
// for swagger
|
||||
filterChainDefinitionMap.put("/swagger-ui.html", "anon");
|
||||
filterChainDefinitionMap.put("/swagger-ui/**", "anon");
|
||||
|
|
|
@ -56,13 +56,9 @@ public class LoginController {
|
|||
}
|
||||
|
||||
@GetMapping(value = "/signout")
|
||||
public ResultHolder logout() {
|
||||
String ssoMode = env.getProperty("sso.mode");
|
||||
if (ssoMode != null && StringUtils.equalsIgnoreCase(SsoMode.CAS.name(), ssoMode)) {
|
||||
return ResultHolder.error("sso");
|
||||
} else {
|
||||
public ResultHolder logout() throws Exception {
|
||||
userService.logout();
|
||||
SecurityUtils.getSubject().logout();
|
||||
}
|
||||
return ResultHolder.success("");
|
||||
}
|
||||
|
||||
|
|
|
@ -389,8 +389,6 @@ public class JmeterDocumentParser implements DocumentParser {
|
|||
element.appendChild(createStringProp(document, "HTTPSampler.concurrentPool", "6"));
|
||||
element.appendChild(createStringProp(document, "HTTPSampler.connect_timeout", ""));
|
||||
element.appendChild(createStringProp(document, "HTTPSampler.response_timeout", ""));
|
||||
element.appendChild(createBoolProp(document, "HTTPSampler.image_parser", true));
|
||||
element.appendChild(createBoolProp(document, "HTTPSampler.concurrentDwn", true));
|
||||
hashTree.appendChild(element);
|
||||
// 空的 hashTree
|
||||
hashTree.appendChild(document.createElement(HASH_TREE_ELEMENT));
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package io.metersphere.service;
|
||||
|
||||
public interface SSOService {
|
||||
void logout() throws Exception;
|
||||
}
|
|
@ -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;
|
||||
|
@ -608,4 +609,11 @@ public class UserService {
|
|||
public List<User> searchUser(String condition) {
|
||||
return extUserMapper.searchUser(condition);
|
||||
}
|
||||
|
||||
public void logout() throws Exception {
|
||||
SSOService ssoService = CommonBeanFactory.getBean(SSOService.class);
|
||||
if (ssoService != null) {
|
||||
ssoService.logout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a18f543c2be6bcd8521a22094bb11aacc920ece4
|
||||
Subproject commit ed891ee7503cc1ca4679b4779a5c12e2ffee986d
|
|
@ -28,6 +28,9 @@ import {getCurrentUser} from "@/common/js/utils";
|
|||
import AboutUs from "./AboutUs";
|
||||
import axios from "axios";
|
||||
|
||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||
const auth = requireComponent.keys().length > 0 ? requireComponent("./auth/Auth.vue") : {};
|
||||
|
||||
export default {
|
||||
name: "MsUser",
|
||||
components: {AboutUs},
|
||||
|
@ -42,13 +45,7 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
handleCommand(command) {
|
||||
switch (command) {
|
||||
case "personal":
|
||||
// TODO 优化路由跳转,避免重复添加路由
|
||||
this.$router.push('/setting/personsetting').catch(error => error);
|
||||
break;
|
||||
case "logout":
|
||||
logout: function () {
|
||||
axios.get("/signout").then(response => {
|
||||
if (response.data.success) {
|
||||
localStorage.clear();
|
||||
|
@ -58,6 +55,15 @@ export default {
|
|||
localStorage.clear();
|
||||
window.location.href = "/login";
|
||||
});
|
||||
},
|
||||
handleCommand(command) {
|
||||
switch (command) {
|
||||
case "personal":
|
||||
// TODO 优化路由跳转,避免重复添加路由
|
||||
this.$router.push('/setting/personsetting').catch(error => error);
|
||||
break;
|
||||
case "logout":
|
||||
this.logout();
|
||||
break;
|
||||
case "about":
|
||||
this.$refs.aboutUs.open();
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 5abe43dc1f65b529ad59c17bfdc58aea33d23cad
|
||||
Subproject commit 6d6ed5226849337876ecf55312aa6b5f13ba6472
|
Loading…
Reference in New Issue