zouyu
2023-08-28 7d9cfe6dae6f3bc1016cdacb497e4724e22ca3db
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,6 +64,10 @@
        newPwd: '',
        confirmPwd: ''
      },
      user: {
            id: null,
            name: 'value'
         },
      dialogFormVisible: false,
      formLabelWidth: '120px',
         user: {
@@ -103,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))
         })
      }
  }