用户角色切换刷新问题
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-12-26 14:37:27 +08:00
parent 9c22809bae
commit 43f99b02c4
5 changed files with 15 additions and 4 deletions

View File

@ -293,6 +293,7 @@ async function VueInit() {
}() }()
_vm.$forceUpdate() _vm.$forceUpdate()
} }
Vue.prototype.$EventBus = new Vue()
Vue.prototype.$path = [] Vue.prototype.$path = []
var t = function (key) { var t = function (key) {
if (!~Vue.prototype.$path.indexOf(key)) { if (!~Vue.prototype.$path.indexOf(key)) {

View File

@ -189,6 +189,7 @@ const actions = {
commit('SET_PERMISSIONS', permissions.Result) commit('SET_PERMISSIONS', permissions.Result)
zzSessionStorage.setItem('newTree', JSON.stringify(menuTree.Result)) zzSessionStorage.setItem('newTree', JSON.stringify(menuTree.Result))
zzSessionStorage.setItem('permissions', JSON.stringify(permissions.Result)) zzSessionStorage.setItem('permissions', JSON.stringify(permissions.Result))
zzSessionStorage.removeItem('lastWorkbench')
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }

View File

@ -270,15 +270,16 @@ export default {
history.go(0) history.go(0)
// this.$router.replace({ path: '/trials/trials-list' }) // this.$router.replace({ path: '/trials/trials-list' })
} else { } else {
history.replaceState(null, null, '/trials') history.replaceState(null, null, '/trials/trials-workbench')
history.go(0) history.go(0)
// this.$router.replace({ path: '/trials/trials-workbench' }) // this.$router.replace({ path: '/trials/trials-workbench' })
} }
this.toggleRoleVisible = false this.toggleRoleVisible = false
this.toggleRoleLoading = false this.toggleRoleLoading = false
this.$nextTick(() => { this.$EventBus.$emit('reload')
window.location.reload() // this.$nextTick(() => {
}) // window.location.reload()
// })
} else { } else {
// //
this.toggleRoleLoading = false this.toggleRoleLoading = false

View File

@ -788,6 +788,11 @@ export default {
created() { created() {
this.initPage() this.initPage()
}, },
mounted(){
this.$EventBus.$on("reload", (data) => {
window.location.reload()
});
},
methods: { methods: {
initPage() { initPage() {
this.getList() this.getList()

View File

@ -487,6 +487,9 @@ export default {
hoursTip=this.$t('common:date:good evening') hoursTip=this.$t('common:date:good evening')
} }
this.hoursTip = hoursTip this.hoursTip = hoursTip
this.$EventBus.$on("reload", (data) => {
window.location.reload()
});
}, },
methods: { methods: {
getUserInfo() { getUserInfo() {