From 721206ac7fc75f3c4719ad58514d84431ed61f41 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 11 Dec 2020 17:33:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=90=8E=E5=88=87=E6=8D=A2=E5=BD=93=E5=89=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/business/components/settings/project/MsProject.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/settings/project/MsProject.vue b/frontend/src/business/components/settings/project/MsProject.vue index c43911e37b..8e22b5eb9f 100644 --- a/frontend/src/business/components/settings/project/MsProject.vue +++ b/frontend/src/business/components/settings/project/MsProject.vue @@ -88,7 +88,7 @@ import MsTablePagination from "../../common/pagination/TablePagination"; import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableOperator from "../../common/components/MsTableOperator"; import MsDialogFooter from "../../common/components/MsDialogFooter"; -import {_sort, getCurrentUser, listenGoBack, removeGoBackListener} from "@/common/js/utils"; +import {_sort, getCurrentProjectID, getCurrentUser, listenGoBack, removeGoBackListener} from "@/common/js/utils"; import MsContainer from "../../common/components/MsContainer"; import MsMainContainer from "../../common/components/MsMainContainer"; import MsDeleteConfirm from "../../common/components/MsDeleteConfirm"; @@ -96,6 +96,7 @@ import MsTableOperatorButton from "../../common/components/MsTableOperatorButton import ApiEnvironmentConfig from "../../api/test/components/ApiEnvironmentConfig"; import TemplateComponent from "../../track/plan/view/comonents/report/TemplateComponent/TemplateComponent"; import {ApiEvent, LIST_CHANGE, PerformanceEvent, TrackEvent} from "@/business/components/common/head/ListEvent"; +import {PROJECT_ID} from "@/common/js/constants"; export default { name: "MsProject", @@ -216,6 +217,10 @@ export default { type: 'warning' }).then(() => { this.$get('/project/delete/' + project.id, () => { + if (project.id === getCurrentProjectID()) { + localStorage.removeItem(PROJECT_ID); + this.$post("/user/update/current", {id: getCurrentUser().id, lastProjectId: ''}); + } Message.success(this.$t('commons.delete_success')); this.list(); // 发送广播,刷新 head 上的最新列表