|
@@ -14,6 +14,7 @@
|
|
|
<script>
|
|
|
import { Navbar, Sidebar, AppMain } from './components'
|
|
|
import ResizeMixin from './mixin/ResizeHandler'
|
|
|
+import { getUserInfo } from '@/api/user.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'Layout',
|
|
@@ -42,6 +43,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ getUserInfo()
|
|
|
+ .then(res => {
|
|
|
+ this.realname = res.data.realname
|
|
|
+ localStorage.setItem('realname', res.data.realname)
|
|
|
+ localStorage.setItem('username', res.data.username)
|
|
|
+ })
|
|
|
+ },
|
|
|
methods: {
|
|
|
handleClickOutside() {
|
|
|
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|