diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java index 3c4e813f7f..bae8ebfcfb 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -150,7 +150,13 @@ public class ApiTestCaseService { private ApiTestCaseRequest initRequest(ApiTestCaseRequest request, boolean setDefultOrders, boolean checkThisWeekData) { if (setDefultOrders) { List orders = ServiceUtils.getDefaultSortOrder(request.getOrders()); - orders.forEach(i -> i.setPrefix("t1")); + orders.forEach(i -> { + if (i.getName().equals("path")) { + i.setPrefix("a"); + } else { + i.setPrefix("t1"); + } + }); request.setOrders(orders); } if (checkThisWeekData) { diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index cc8ffda846..750a2291b9 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -234,7 +234,14 @@ order by - t1.${order.name} ${order.type} + + + a.${order.name} ${order.type} + + + t1.${order.name} ${order.type} + + diff --git a/frontend/src/business/components/common/head/HeaderUser.vue b/frontend/src/business/components/common/head/HeaderUser.vue index 05f6fc91f9..2f1bddfd3a 100644 --- a/frontend/src/business/components/common/head/HeaderUser.vue +++ b/frontend/src/business/components/common/head/HeaderUser.vue @@ -29,6 +29,7 @@ import AboutUs from "./AboutUs"; import axios from "axios"; import {mapGetters} from "vuex"; import {ORGANIZATION_ID, PROJECT_ID, TokenKey, WORKSPACE_ID} from "@/common/js/constants"; +import {logout} from "@/network/user"; const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const auth = requireComponent.keys().length > 0 ? requireComponent("./auth/Auth.vue") : {}; @@ -51,23 +52,7 @@ export default { }, methods: { logout: function () { - axios.get("/signout").then(response => { - if (response.data.success) { - localStorage.removeItem(TokenKey); - - sessionStorage.removeItem(ORGANIZATION_ID); - sessionStorage.removeItem(WORKSPACE_ID); - sessionStorage.removeItem(PROJECT_ID); - window.location.href = "/login"; - } - }).catch(error => { - localStorage.removeItem(TokenKey); - - sessionStorage.removeItem(ORGANIZATION_ID); - sessionStorage.removeItem(WORKSPACE_ID); - sessionStorage.removeItem(PROJECT_ID); - window.location.href = "/login"; - }); + logout(); }, handleCommand(command) { switch (command) { diff --git a/frontend/src/business/components/settings/personal/PersonSetting.vue b/frontend/src/business/components/settings/personal/PersonSetting.vue index f325c0f0ce..30b28aa589 100644 --- a/frontend/src/business/components/settings/personal/PersonSetting.vue +++ b/frontend/src/business/components/settings/personal/PersonSetting.vue @@ -102,6 +102,7 @@ import TapdUserInfo from "@/business/components/settings/personal/TapdUserInfo"; import {getIntegrationService} from "@/network/organization"; import ZentaoUserInfo from "@/business/components/settings/personal/ZentaoUserInfo"; import AzureDevopsUserInfo from "@/business/components/settings/personal/AzureDevopsUserInfo"; +import {logout} from "@/network/user"; export default { name: "MsPersonSetting", @@ -267,9 +268,7 @@ export default { } this.result = this.$post(this.updatePasswordPath, this.ruleForm, response => { this.$success(this.$t('commons.modify_success')); - this.editPasswordVisible = false; - this.initTableData(); - this.reload(); + logout(); }); } else { return false; diff --git a/frontend/src/business/components/settings/system/User.vue b/frontend/src/business/components/settings/system/User.vue index 76afde6994..a357789db5 100644 --- a/frontend/src/business/components/settings/system/User.vue +++ b/frontend/src/business/components/settings/system/User.vue @@ -129,6 +129,7 @@ import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn import EditUser from "@/business/components/settings/system/EditUser"; import ProjectCascader from "@/business/components/settings/system/components/ProjectCascader"; import GroupCascader from "@/business/components/settings/system/components/GroupCascader"; +import {logout} from "@/network/user"; export default { name: "MsUser", @@ -189,6 +190,7 @@ export default { id: '' }] }, + changePasswordUser: '', screenHeight: 'calc(100vh - 195px)', checkPasswordForm: {}, ruleForm: {}, @@ -280,6 +282,7 @@ export default { this.$refs.editUser.open("Edit", this.$t('user.modify'), row); }, editPassword(row) { + this.changePasswordUser = row.id; this.editPasswordVisible = true; this.ruleForm = Object.assign({}, row); listenGoBack(this.handleClose); @@ -329,9 +332,13 @@ export default { if (valid) { this.result = this.$post(this.editPasswordPath, this.ruleForm, () => { this.$success(this.$t('commons.modify_success')); - this.editPasswordVisible = false; - this.search(); - this.reload(); + if (this.changePasswordUser === getCurrentUser().id) { + logout(); + } else { + this.editPasswordVisible = false; + this.search(); + this.reload(); + } }); } else { return false; diff --git a/frontend/src/network/user.js b/frontend/src/network/user.js index 81abb8ae3a..4606bcedc4 100644 --- a/frontend/src/network/user.js +++ b/frontend/src/network/user.js @@ -1,5 +1,7 @@ import {getCurrentProjectID} from "@/common/js/utils"; import {post} from "@/common/js/ajax"; +import axios from "axios"; +import {ORGANIZATION_ID, PROJECT_ID, TokenKey, WORKSPACE_ID} from "@/common/js/constants"; export function getProjectMember(callBack) { return new Promise((resolve) => { @@ -11,3 +13,23 @@ export function getProjectMember(callBack) { }); }); } + +export function logout() { + axios.get("/signout").then(response => { + if (response.data.success) { + localStorage.removeItem(TokenKey); + + sessionStorage.removeItem(ORGANIZATION_ID); + sessionStorage.removeItem(WORKSPACE_ID); + sessionStorage.removeItem(PROJECT_ID); + window.location.href = "/login"; + } + }).catch(error => { + localStorage.removeItem(TokenKey); + + sessionStorage.removeItem(ORGANIZATION_ID); + sessionStorage.removeItem(WORKSPACE_ID); + sessionStorage.removeItem(PROJECT_ID); + window.location.href = "/login"; + }); +}