fix 修复 切换租户 页面tab未清空问题

This commit is contained in:
疯狂的狮子li 2023-02-09 19:45:17 +08:00
parent 6b4c1b4c94
commit 0e172d2aa1
2 changed files with 9 additions and 6 deletions

View File

@ -21,6 +21,7 @@
:label="item.companyName"
:value="item.tenantId">
</el-option>
<svg-icon slot="prefix" icon-class="company" class="el-input__icon input-icon" />
</el-select>
<search id="header-search" class="right-menu-item" />
@ -123,13 +124,15 @@ export default {
dynamicTenantEvent(tenantId) {
if (this.companyName != null && this.companyName !== '') {
dynamicTenant(tenantId).then(res => {
this.$router.push("/index");
this.$tab.closeAllPage()
this.$router.push('/')
});
}
},
dynamicClearEvent() {
dynamicClear().then(res => {
this.$router.push("/index");
this.$tab.closeAllPage()
this.$router.push('/')
});
},
//

View File

@ -3,16 +3,16 @@ import { getToken, setToken, removeToken } from '@/utils/auth'
const user = {
state: {
userId: undefined,
token: getToken(),
name: '',
avatar: '',
roles: [],
permissions: [],
userId: null
permissions: []
},
mutations: {
SET_USERID: (state, userId) => {
SET_USER_ID: (state, userId) => {
state.userId = userId
},
SET_TOKEN: (state, token) => {
@ -65,7 +65,7 @@ const user = {
}
commit('SET_NAME', user.userName)
commit('SET_AVATAR', avatar)
commit('SET_USERID', user.userId)
commit('SET_USER_ID', user.userId)
resolve(res)
}).catch(error => {
reject(error)