From 7d9cfe6dae6f3bc1016cdacb497e4724e22ca3db Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期一, 28 八月 2023 14:30:37 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.110.209:9001/r/lims-before --- src/layout/components/Navbar.vue | 26 +++++++++++++++----------- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 5d90276..ba4d987 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -24,7 +24,7 @@ </el-dropdown-item> </el-dropdown-menu> </el-dropdown> - <el-dialog title="淇敼瀵嗙爜" :visible.sync="dialogFormVisible" :append-to-body="true"> + <el-dialog title="淇敼瀵嗙爜" :visible.sync="dialogFormVisible" :append-to-body="true" width="40%"> <el-form :model="form"> <el-form-item label="鏃у瘑鐮�" :label-width="formLabelWidth"> <el-input v-model="form.oldPwd" autocomplete="off"></el-input> @@ -64,8 +64,16 @@ newPwd: '', confirmPwd: '' }, + user: { + id: null, + name: 'value' + }, dialogFormVisible: false, - formLabelWidth: '120px' + formLabelWidth: '120px', + user: { + id: null, + name: 'value' + } } }, components: { @@ -78,14 +86,6 @@ 'avatar' ]) }, - data() { - return { - user: { - id: null, - name: 'value' - } - } - }, mounted() { this.getUser() }, @@ -107,11 +107,15 @@ }, async logout() { // await this.$store.dispatch('user/logout') - this.$router.push(`/login?redirect=${this.$route.fullPath}`) + sessionStorage.removeItem("user") + this.$router.push(`/login?redirect=${this.$route.fullPath}`) + this.$router.replace({path: '/login'}); + location.reload(); }, getUser(){ get(this.$url.info).then(res=>{ this.user = res.data + sessionStorage.setItem("user",JSON.stringify(res.data)) }) } } -- Gitblit v1.9.3