Merge branch 'main' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
ab83e242eb
|
@ -5,8 +5,8 @@ export function login(url, data) {
|
|||
return post(url, data)
|
||||
}
|
||||
|
||||
export function logout(sessionId) {
|
||||
return sessionId ? get("/signout?X-AUTH-TOKEN=" + sessionId) : get("/signout");
|
||||
export function logout() {
|
||||
return get("/signout");
|
||||
}
|
||||
|
||||
export function isLogin() {
|
||||
|
|
|
@ -111,19 +111,20 @@ export default {
|
|||
},
|
||||
|
||||
userLogout() {
|
||||
let user = JSON.parse(localStorage.getItem(TokenKey));
|
||||
let sessionId = user ? user.sessionId : null;
|
||||
clearSessionStorage();
|
||||
return new Promise((resolve, reject) => {
|
||||
logout(sessionId).then(() => {
|
||||
location.href = '/#/login';
|
||||
location.reload();
|
||||
resolve();
|
||||
}).catch(error => {
|
||||
location.href = '/#/login';
|
||||
location.reload();
|
||||
reject(error);
|
||||
})
|
||||
logout()
|
||||
.then(() => {
|
||||
clearSessionStorage();
|
||||
location.href = '/#/login';
|
||||
location.reload();
|
||||
resolve();
|
||||
})
|
||||
.catch(error => {
|
||||
clearSessionStorage();
|
||||
location.href = '/#/login';
|
||||
location.reload();
|
||||
reject(error);
|
||||
});
|
||||
})
|
||||
},
|
||||
switchWorkspace(response) {
|
||||
|
|
|
@ -95,10 +95,9 @@ public class LoginController {
|
|||
|
||||
@GetMapping(value = "/signout")
|
||||
@MsAuditLog(module = OperLogModule.AUTH_TITLE, beforeEvent = "#msClass.getUserId(id)", type = OperLogConstants.LOGIN, title = "登出", msClass = SessionUtils.class)
|
||||
public ResultHolder logout(@RequestParam(name = SessionConstants.HEADER_TOKEN, required = false) String sessionId, HttpServletResponse response) throws Exception {
|
||||
ssoLogoutService.logout(sessionId, response);
|
||||
public void logout(HttpServletResponse response) throws Exception {
|
||||
ssoLogoutService.logout(SessionUtils.getSessionId(), response);
|
||||
SecurityUtils.getSubject().logout();
|
||||
return ResultHolder.success(StringUtils.EMPTY);
|
||||
}
|
||||
|
||||
/*Get default language*/
|
||||
|
|
|
@ -350,10 +350,7 @@ export default {
|
|||
this.editParam();
|
||||
},
|
||||
methods: {
|
||||
generateColumnKey(field){
|
||||
let columnKey = generateColumnKey(field);
|
||||
return "custom_" + columnKey.substr(columnKey.indexOf("-") + 1);
|
||||
},
|
||||
generateColumnKey,
|
||||
hasPermission,
|
||||
tableDoLayout() {
|
||||
if (this.$refs.table) this.$refs.table.doLayout();
|
||||
|
|
Loading…
Reference in New Issue