删除无用代码

This commit is contained in:
shiziyuan9527 2020-05-12 11:01:56 +08:00
parent 290df82611
commit 5ad9d37bda
1 changed files with 7 additions and 4 deletions

View File

@ -62,10 +62,10 @@
data() { data() {
return { return {
organizationList: [ organizationList: [
{index: '7-1', name: this.$t('organization.none')}, {name: this.$t('organization.none')},
], ],
workspaceList: [ workspaceList: [
{index: '2-1', name: this.$t('workspace.none')}, {name: this.$t('workspace.none')},
], ],
currentUserInfo: {}, currentUserInfo: {},
currentUserId: getCurrentUser().id, currentUserId: getCurrentUser().id,
@ -113,7 +113,7 @@
this.$get("/workspace/list/orgworkspace/", response => { this.$get("/workspace/list/orgworkspace/", response => {
let data = response.data; let data = response.data;
if (data.length === 0) { if (data.length === 0) {
this.workspaceList = [{index: '1-1', name: this.$t('workspace.none')}] this.workspaceList = [{name: this.$t('workspace.none')}]
} else { } else {
this.workspaceList = data; this.workspaceList = data;
let workspace = data.filter(r => r.id === this.currentUser.lastWorkspaceId); let workspace = data.filter(r => r.id === this.currentUser.lastWorkspaceId);
@ -132,11 +132,14 @@
}, },
changeOrg(data) { changeOrg(data) {
let orgId = data.id; let orgId = data.id;
if (!orgId) {
return false;
}
this.$post("/user/switch/source/org/" + orgId, {}, response => { this.$post("/user/switch/source/org/" + orgId, {}, response => {
saveLocalStorage(response); saveLocalStorage(response);
this.$router.push('/'); this.$router.push('/');
window.location.reload(); window.location.reload();
}) });
}, },
changeWs(data) { changeWs(data) {
let workspaceId = data.id; let workspaceId = data.id;