| | |
| | | newPwd: '', |
| | | confirmPwd: '' |
| | | }, |
| | | user: { |
| | | id: null, |
| | | name: 'value' |
| | | }, |
| | | dialogFormVisible: false, |
| | | formLabelWidth: '120px' |
| | | } |
| | |
| | | 'avatar' |
| | | ]) |
| | | }, |
| | | data() { |
| | | return { |
| | | user: { |
| | | id: null, |
| | | name: 'value' |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getUser() |
| | | }, |
| | |
| | | }, |
| | | async logout() { |
| | | // await this.$store.dispatch('user/logout') |
| | | this.$router.push(`/login?redirect=${this.$route.fullPath}`) |
| | | localStorage.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 |
| | | localStorage.setItem("user",JSON.stringify(res.data)) |
| | | }) |
| | | } |
| | | } |